--
-- PostgreSQL database dump
--

-- Dumped from database version 9.1.4
-- Dumped by pg_dump version 9.1.14
-- Started on 2014-10-09 17:33:12 CDT

SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;

SET search_path = public, pg_catalog;

--
-- TOC entry 2811 (class 0 OID 0)
-- Name: chkpass; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE chkpass;


--
-- TOC entry 1199 (class 1255 OID 85072)
-- Dependencies: 11 2811
-- Name: chkpass_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION chkpass_in(cstring) RETURNS chkpass
    LANGUAGE c STRICT
    AS '$libdir/chkpass', 'chkpass_in';


ALTER FUNCTION public.chkpass_in(cstring) OWNER TO postgres;

--
-- TOC entry 1200 (class 1255 OID 85073)
-- Dependencies: 11 2811
-- Name: chkpass_out(chkpass); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION chkpass_out(chkpass) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/chkpass', 'chkpass_out';


ALTER FUNCTION public.chkpass_out(chkpass) OWNER TO postgres;

--
-- TOC entry 2810 (class 1247 OID 85071)
-- Dependencies: 1200 1199 11
-- Name: chkpass; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE chkpass (
    INTERNALLENGTH = 16,
    INPUT = chkpass_in,
    OUTPUT = chkpass_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.chkpass OWNER TO postgres;

--
-- TOC entry 8875 (class 0 OID 0)
-- Dependencies: 2810
-- Name: TYPE chkpass; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE chkpass IS 'password type with checks';


--
-- TOC entry 2817 (class 0 OID 0)
-- Name: cube; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE cube;


--
-- TOC entry 1201 (class 1255 OID 85076)
-- Dependencies: 11 2817
-- Name: cube_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_in(cstring) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_in';


ALTER FUNCTION public.cube_in(cstring) OWNER TO postgres;

--
-- TOC entry 1202 (class 1255 OID 85077)
-- Dependencies: 11 2817
-- Name: cube_out(cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_out(cube) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_out';


ALTER FUNCTION public.cube_out(cube) OWNER TO postgres;

--
-- TOC entry 2816 (class 1247 OID 85075)
-- Dependencies: 1202 1201 11
-- Name: cube; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE cube (
    INTERNALLENGTH = variable,
    INPUT = cube_in,
    OUTPUT = cube_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.cube OWNER TO postgres;

--
-- TOC entry 8876 (class 0 OID 0)
-- Dependencies: 2816
-- Name: TYPE cube; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE cube IS 'multi-dimensional cube ''(FLOAT-1, FLOAT-2, ..., FLOAT-N), (FLOAT-1, FLOAT-2, ..., FLOAT-N)''';


--
-- TOC entry 2820 (class 1247 OID 85081)
-- Dependencies: 11 322
-- Name: dblink_pkey_results; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE dblink_pkey_results AS (
	"position" integer,
	colname text
);


ALTER TYPE public.dblink_pkey_results OWNER TO postgres;

--
-- TOC entry 2824 (class 0 OID 0)
-- Name: ean13; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ean13;


--
-- TOC entry 1203 (class 1255 OID 85083)
-- Dependencies: 11 2824
-- Name: ean13_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ean13_in(cstring) RETURNS ean13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ean13_in';


ALTER FUNCTION public.ean13_in(cstring) OWNER TO postgres;

--
-- TOC entry 1204 (class 1255 OID 85084)
-- Dependencies: 11 2824
-- Name: ean13_out(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ean13_out(ean13) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ean13_out';


ALTER FUNCTION public.ean13_out(ean13) OWNER TO postgres;

--
-- TOC entry 2823 (class 1247 OID 85082)
-- Dependencies: 1204 1203 11
-- Name: ean13; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ean13 (
    INTERNALLENGTH = 8,
    INPUT = ean13_in,
    OUTPUT = public.ean13_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.ean13 OWNER TO postgres;

--
-- TOC entry 8877 (class 0 OID 0)
-- Dependencies: 2823
-- Name: TYPE ean13; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE ean13 IS 'International European Article Number (EAN13)';


--
-- TOC entry 1205 (class 1255 OID 85086)
-- Dependencies: 2816 11
-- Name: cube_dim(cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_dim(cube) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_dim';


ALTER FUNCTION public.cube_dim(cube) OWNER TO postgres;

--
-- TOC entry 1206 (class 1255 OID 85087)
-- Dependencies: 2816 2816 11
-- Name: cube_distance(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_distance(cube, cube) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_distance';


ALTER FUNCTION public.cube_distance(cube, cube) OWNER TO postgres;

--
-- TOC entry 1207 (class 1255 OID 85088)
-- Dependencies: 2816 11
-- Name: cube_is_point(cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_is_point(cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_is_point';


ALTER FUNCTION public.cube_is_point(cube) OWNER TO postgres;

--
-- TOC entry 1208 (class 1255 OID 85089)
-- Dependencies: 11
-- Name: earth(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION earth() RETURNS double precision
    LANGUAGE sql IMMUTABLE
    AS $$SELECT '6378168'::float8$$;


ALTER FUNCTION public.earth() OWNER TO postgres;

--
-- TOC entry 2827 (class 1247 OID 85090)
-- Dependencies: 2828 2829 2830 2816 1202 11
-- Name: earth; Type: DOMAIN; Schema: public; Owner: postgres
--

CREATE DOMAIN earth AS cube
	CONSTRAINT not_3d CHECK ((cube_dim(VALUE) <= 3))
	CONSTRAINT not_point CHECK (cube_is_point(VALUE))
	CONSTRAINT on_surface CHECK ((abs(((cube_distance(VALUE, '(0)'::cube) / earth()) - (1)::double precision)) < (0.00000099999999999999995)::double precision));


ALTER DOMAIN public.earth OWNER TO postgres;

--
-- TOC entry 2834 (class 0 OID 0)
-- Name: gbtreekey16; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey16;


--
-- TOC entry 1209 (class 1255 OID 85095)
-- Dependencies: 11 2834
-- Name: gbtreekey16_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey16_in(cstring) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_in';


ALTER FUNCTION public.gbtreekey16_in(cstring) OWNER TO postgres;

--
-- TOC entry 1210 (class 1255 OID 85096)
-- Dependencies: 11 2834
-- Name: gbtreekey16_out(gbtreekey16); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey16_out(gbtreekey16) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_out';


ALTER FUNCTION public.gbtreekey16_out(gbtreekey16) OWNER TO postgres;

--
-- TOC entry 2833 (class 1247 OID 85094)
-- Dependencies: 1210 1209 11
-- Name: gbtreekey16; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey16 (
    INTERNALLENGTH = 16,
    INPUT = gbtreekey16_in,
    OUTPUT = gbtreekey16_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.gbtreekey16 OWNER TO postgres;

--
-- TOC entry 2809 (class 0 OID 0)
-- Name: gbtreekey32; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey32;


--
-- TOC entry 1211 (class 1255 OID 85099)
-- Dependencies: 11 2809
-- Name: gbtreekey32_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey32_in(cstring) RETURNS gbtreekey32
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_in';


ALTER FUNCTION public.gbtreekey32_in(cstring) OWNER TO postgres;

--
-- TOC entry 1212 (class 1255 OID 85100)
-- Dependencies: 11 2809
-- Name: gbtreekey32_out(gbtreekey32); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey32_out(gbtreekey32) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_out';


ALTER FUNCTION public.gbtreekey32_out(gbtreekey32) OWNER TO postgres;

--
-- TOC entry 2808 (class 1247 OID 85098)
-- Dependencies: 1212 1211 11
-- Name: gbtreekey32; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey32 (
    INTERNALLENGTH = 32,
    INPUT = gbtreekey32_in,
    OUTPUT = gbtreekey32_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.gbtreekey32 OWNER TO postgres;

--
-- TOC entry 2838 (class 0 OID 0)
-- Name: gbtreekey4; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey4;


--
-- TOC entry 1213 (class 1255 OID 85103)
-- Dependencies: 11 2838
-- Name: gbtreekey4_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey4_in(cstring) RETURNS gbtreekey4
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_in';


ALTER FUNCTION public.gbtreekey4_in(cstring) OWNER TO postgres;

--
-- TOC entry 1214 (class 1255 OID 85104)
-- Dependencies: 11 2838
-- Name: gbtreekey4_out(gbtreekey4); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey4_out(gbtreekey4) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_out';


ALTER FUNCTION public.gbtreekey4_out(gbtreekey4) OWNER TO postgres;

--
-- TOC entry 2837 (class 1247 OID 85102)
-- Dependencies: 1214 1213 11
-- Name: gbtreekey4; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey4 (
    INTERNALLENGTH = 4,
    INPUT = gbtreekey4_in,
    OUTPUT = gbtreekey4_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.gbtreekey4 OWNER TO postgres;

--
-- TOC entry 2844 (class 0 OID 0)
-- Name: gbtreekey8; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey8;


--
-- TOC entry 1215 (class 1255 OID 85107)
-- Dependencies: 11 2844
-- Name: gbtreekey8_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey8_in(cstring) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_in';


ALTER FUNCTION public.gbtreekey8_in(cstring) OWNER TO postgres;

--
-- TOC entry 1216 (class 1255 OID 85108)
-- Dependencies: 11 2844
-- Name: gbtreekey8_out(gbtreekey8); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey8_out(gbtreekey8) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_out';


ALTER FUNCTION public.gbtreekey8_out(gbtreekey8) OWNER TO postgres;

--
-- TOC entry 2843 (class 1247 OID 85106)
-- Dependencies: 1216 1215 11
-- Name: gbtreekey8; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey8 (
    INTERNALLENGTH = 8,
    INPUT = gbtreekey8_in,
    OUTPUT = gbtreekey8_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.gbtreekey8 OWNER TO postgres;

--
-- TOC entry 2850 (class 0 OID 0)
-- Name: gbtreekey_var; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey_var;


--
-- TOC entry 1217 (class 1255 OID 85111)
-- Dependencies: 11 2850
-- Name: gbtreekey_var_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey_var_in(cstring) RETURNS gbtreekey_var
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_in';


ALTER FUNCTION public.gbtreekey_var_in(cstring) OWNER TO postgres;

--
-- TOC entry 1218 (class 1255 OID 85112)
-- Dependencies: 11 2850
-- Name: gbtreekey_var_out(gbtreekey_var); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbtreekey_var_out(gbtreekey_var) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbtreekey_out';


ALTER FUNCTION public.gbtreekey_var_out(gbtreekey_var) OWNER TO postgres;

--
-- TOC entry 2849 (class 1247 OID 85110)
-- Dependencies: 1218 1217 11
-- Name: gbtreekey_var; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gbtreekey_var (
    INTERNALLENGTH = variable,
    INPUT = gbtreekey_var_in,
    OUTPUT = gbtreekey_var_out,
    ALIGNMENT = int4,
    STORAGE = extended
);


ALTER TYPE public.gbtreekey_var OWNER TO postgres;

--
-- TOC entry 2852 (class 0 OID 0)
-- Name: ghstore; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ghstore;


--
-- TOC entry 1219 (class 1255 OID 85115)
-- Dependencies: 11 2852
-- Name: ghstore_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_in(cstring) RETURNS ghstore
    LANGUAGE c STRICT
    AS '$libdir/hstore', 'ghstore_in';


ALTER FUNCTION public.ghstore_in(cstring) OWNER TO postgres;

--
-- TOC entry 1220 (class 1255 OID 85116)
-- Dependencies: 11 2852
-- Name: ghstore_out(ghstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_out(ghstore) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/hstore', 'ghstore_out';


ALTER FUNCTION public.ghstore_out(ghstore) OWNER TO postgres;

--
-- TOC entry 2851 (class 1247 OID 85114)
-- Dependencies: 1220 1219 11
-- Name: ghstore; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ghstore (
    INTERNALLENGTH = variable,
    INPUT = ghstore_in,
    OUTPUT = ghstore_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.ghstore OWNER TO postgres;

--
-- TOC entry 2842 (class 0 OID 0)
-- Name: gtrgm; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gtrgm;


--
-- TOC entry 1221 (class 1255 OID 85119)
-- Dependencies: 11 2842
-- Name: gtrgm_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_in(cstring) RETURNS gtrgm
    LANGUAGE c STRICT
    AS '$libdir/pg_trgm', 'gtrgm_in';


ALTER FUNCTION public.gtrgm_in(cstring) OWNER TO postgres;

--
-- TOC entry 1222 (class 1255 OID 85120)
-- Dependencies: 11 2842
-- Name: gtrgm_out(gtrgm); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_out(gtrgm) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/pg_trgm', 'gtrgm_out';


ALTER FUNCTION public.gtrgm_out(gtrgm) OWNER TO postgres;

--
-- TOC entry 2841 (class 1247 OID 85118)
-- Dependencies: 1222 1221 11
-- Name: gtrgm; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE gtrgm (
    INTERNALLENGTH = variable,
    INPUT = gtrgm_in,
    OUTPUT = gtrgm_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.gtrgm OWNER TO postgres;

--
-- TOC entry 2860 (class 0 OID 0)
-- Name: hstore; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE hstore;


--
-- TOC entry 1223 (class 1255 OID 85123)
-- Dependencies: 11 2860
-- Name: hstore_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hstore_in(cstring) RETURNS hstore
    LANGUAGE c STRICT
    AS '$libdir/hstore', 'hstore_in';


ALTER FUNCTION public.hstore_in(cstring) OWNER TO postgres;

--
-- TOC entry 1224 (class 1255 OID 85124)
-- Dependencies: 11 2860
-- Name: hstore_out(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hstore_out(hstore) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/hstore', 'hstore_out';


ALTER FUNCTION public.hstore_out(hstore) OWNER TO postgres;

--
-- TOC entry 2859 (class 1247 OID 85122)
-- Dependencies: 1224 1223 11
-- Name: hstore; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE hstore (
    INTERNALLENGTH = variable,
    INPUT = hstore_in,
    OUTPUT = hstore_out,
    ALIGNMENT = int4,
    STORAGE = extended
);


ALTER TYPE public.hstore OWNER TO postgres;

--
-- TOC entry 2858 (class 0 OID 0)
-- Name: intbig_gkey; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE intbig_gkey;


--
-- TOC entry 1225 (class 1255 OID 85127)
-- Dependencies: 11 2858
-- Name: _intbig_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _intbig_in(cstring) RETURNS intbig_gkey
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_intbig_in';


ALTER FUNCTION public._intbig_in(cstring) OWNER TO postgres;

--
-- TOC entry 1226 (class 1255 OID 85128)
-- Dependencies: 11 2858
-- Name: _intbig_out(intbig_gkey); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _intbig_out(intbig_gkey) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_intbig_out';


ALTER FUNCTION public._intbig_out(intbig_gkey) OWNER TO postgres;

--
-- TOC entry 2857 (class 1247 OID 85126)
-- Dependencies: 1226 1225 11
-- Name: intbig_gkey; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE intbig_gkey (
    INTERNALLENGTH = variable,
    INPUT = _intbig_in,
    OUTPUT = _intbig_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.intbig_gkey OWNER TO postgres;

--
-- TOC entry 2864 (class 0 OID 0)
-- Name: isbn; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE isbn;


--
-- TOC entry 1227 (class 1255 OID 85131)
-- Dependencies: 11 2864
-- Name: isbn_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isbn_in(cstring) RETURNS isbn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isbn_in';


ALTER FUNCTION public.isbn_in(cstring) OWNER TO postgres;

--
-- TOC entry 1228 (class 1255 OID 85132)
-- Dependencies: 11 2864
-- Name: isn_out(isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_out(isbn) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isn_out';


ALTER FUNCTION public.isn_out(isbn) OWNER TO postgres;

--
-- TOC entry 2863 (class 1247 OID 85130)
-- Dependencies: 1228 1227 11
-- Name: isbn; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE isbn (
    INTERNALLENGTH = 8,
    INPUT = isbn_in,
    OUTPUT = public.isn_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.isbn OWNER TO postgres;

--
-- TOC entry 8878 (class 0 OID 0)
-- Dependencies: 2863
-- Name: TYPE isbn; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE isbn IS 'International Standard Book Number (ISBN)';


--
-- TOC entry 2868 (class 0 OID 0)
-- Name: isbn13; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE isbn13;


--
-- TOC entry 1229 (class 1255 OID 85135)
-- Dependencies: 11 2868
-- Name: ean13_out(isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ean13_out(isbn13) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ean13_out';


ALTER FUNCTION public.ean13_out(isbn13) OWNER TO postgres;

--
-- TOC entry 1230 (class 1255 OID 85136)
-- Dependencies: 11 2868
-- Name: isbn13_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isbn13_in(cstring) RETURNS isbn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isbn_in';


ALTER FUNCTION public.isbn13_in(cstring) OWNER TO postgres;

--
-- TOC entry 2867 (class 1247 OID 85134)
-- Dependencies: 1229 1230 11
-- Name: isbn13; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE isbn13 (
    INTERNALLENGTH = 8,
    INPUT = isbn13_in,
    OUTPUT = public.ean13_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.isbn13 OWNER TO postgres;

--
-- TOC entry 8879 (class 0 OID 0)
-- Dependencies: 2867
-- Name: TYPE isbn13; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE isbn13 IS 'International Standard Book Number 13 (ISBN13)';


--
-- TOC entry 2885 (class 0 OID 0)
-- Name: ismn; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ismn;


--
-- TOC entry 1231 (class 1255 OID 85139)
-- Dependencies: 11 2885
-- Name: ismn_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ismn_in(cstring) RETURNS ismn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ismn_in';


ALTER FUNCTION public.ismn_in(cstring) OWNER TO postgres;

--
-- TOC entry 1232 (class 1255 OID 85140)
-- Dependencies: 11 2885
-- Name: isn_out(ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_out(ismn) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isn_out';


ALTER FUNCTION public.isn_out(ismn) OWNER TO postgres;

--
-- TOC entry 2884 (class 1247 OID 85138)
-- Dependencies: 1232 1231 11
-- Name: ismn; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ismn (
    INTERNALLENGTH = 8,
    INPUT = ismn_in,
    OUTPUT = public.isn_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.ismn OWNER TO postgres;

--
-- TOC entry 8880 (class 0 OID 0)
-- Dependencies: 2884
-- Name: TYPE ismn; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE ismn IS 'International Standard Music Number (ISMN)';


--
-- TOC entry 2891 (class 0 OID 0)
-- Name: ismn13; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ismn13;


--
-- TOC entry 1233 (class 1255 OID 85143)
-- Dependencies: 11 2891
-- Name: ean13_out(ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ean13_out(ismn13) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ean13_out';


ALTER FUNCTION public.ean13_out(ismn13) OWNER TO postgres;

--
-- TOC entry 1234 (class 1255 OID 85144)
-- Dependencies: 11 2891
-- Name: ismn13_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ismn13_in(cstring) RETURNS ismn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ismn_in';


ALTER FUNCTION public.ismn13_in(cstring) OWNER TO postgres;

--
-- TOC entry 2890 (class 1247 OID 85142)
-- Dependencies: 1233 1234 11
-- Name: ismn13; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ismn13 (
    INTERNALLENGTH = 8,
    INPUT = ismn13_in,
    OUTPUT = public.ean13_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.ismn13 OWNER TO postgres;

--
-- TOC entry 8881 (class 0 OID 0)
-- Dependencies: 2890
-- Name: TYPE ismn13; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE ismn13 IS 'International Standard Music Number 13 (ISMN13)';


--
-- TOC entry 2895 (class 0 OID 0)
-- Name: issn; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE issn;


--
-- TOC entry 1235 (class 1255 OID 85147)
-- Dependencies: 11 2895
-- Name: isn_out(issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_out(issn) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isn_out';


ALTER FUNCTION public.isn_out(issn) OWNER TO postgres;

--
-- TOC entry 1236 (class 1255 OID 85148)
-- Dependencies: 11 2895
-- Name: issn_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION issn_in(cstring) RETURNS issn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'issn_in';


ALTER FUNCTION public.issn_in(cstring) OWNER TO postgres;

--
-- TOC entry 2894 (class 1247 OID 85146)
-- Dependencies: 1235 1236 11
-- Name: issn; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE issn (
    INTERNALLENGTH = 8,
    INPUT = issn_in,
    OUTPUT = public.isn_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.issn OWNER TO postgres;

--
-- TOC entry 8882 (class 0 OID 0)
-- Dependencies: 2894
-- Name: TYPE issn; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE issn IS 'International Standard Serial Number (ISSN)';


--
-- TOC entry 2901 (class 0 OID 0)
-- Name: issn13; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE issn13;


--
-- TOC entry 1237 (class 1255 OID 85151)
-- Dependencies: 11 2901
-- Name: ean13_out(issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ean13_out(issn13) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ean13_out';


ALTER FUNCTION public.ean13_out(issn13) OWNER TO postgres;

--
-- TOC entry 1238 (class 1255 OID 85152)
-- Dependencies: 11 2901
-- Name: issn13_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION issn13_in(cstring) RETURNS issn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'issn_in';


ALTER FUNCTION public.issn13_in(cstring) OWNER TO postgres;

--
-- TOC entry 2900 (class 1247 OID 85150)
-- Dependencies: 1237 1238 11
-- Name: issn13; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE issn13 (
    INTERNALLENGTH = 8,
    INPUT = issn13_in,
    OUTPUT = public.ean13_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.issn13 OWNER TO postgres;

--
-- TOC entry 8883 (class 0 OID 0)
-- Dependencies: 2900
-- Name: TYPE issn13; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE issn13 IS 'International Standard Serial Number 13 (ISSN13)';


--
-- TOC entry 2904 (class 1247 OID 85154)
-- Dependencies: 11
-- Name: lo; Type: DOMAIN; Schema: public; Owner: postgres
--

CREATE DOMAIN lo AS oid;


ALTER DOMAIN public.lo OWNER TO postgres;

--
-- TOC entry 2906 (class 0 OID 0)
-- Name: lquery; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE lquery;


--
-- TOC entry 1239 (class 1255 OID 85156)
-- Dependencies: 11 2906
-- Name: lquery_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lquery_in(cstring) RETURNS lquery
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'lquery_in';


ALTER FUNCTION public.lquery_in(cstring) OWNER TO postgres;

--
-- TOC entry 1240 (class 1255 OID 85157)
-- Dependencies: 11 2906
-- Name: lquery_out(lquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lquery_out(lquery) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'lquery_out';


ALTER FUNCTION public.lquery_out(lquery) OWNER TO postgres;

--
-- TOC entry 2905 (class 1247 OID 85155)
-- Dependencies: 1240 1239 11
-- Name: lquery; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE lquery (
    INTERNALLENGTH = variable,
    INPUT = lquery_in,
    OUTPUT = lquery_out,
    ALIGNMENT = int4,
    STORAGE = extended
);


ALTER TYPE public.lquery OWNER TO postgres;

--
-- TOC entry 2883 (class 0 OID 0)
-- Name: ltree; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltree;


--
-- TOC entry 1241 (class 1255 OID 85160)
-- Dependencies: 11 2883
-- Name: ltree_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_in(cstring) RETURNS ltree
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltree_in';


ALTER FUNCTION public.ltree_in(cstring) OWNER TO postgres;

--
-- TOC entry 1242 (class 1255 OID 85161)
-- Dependencies: 11 2883
-- Name: ltree_out(ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_out(ltree) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltree_out';


ALTER FUNCTION public.ltree_out(ltree) OWNER TO postgres;

--
-- TOC entry 2882 (class 1247 OID 85159)
-- Dependencies: 1242 1241 11
-- Name: ltree; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltree (
    INTERNALLENGTH = variable,
    INPUT = ltree_in,
    OUTPUT = ltree_out,
    ALIGNMENT = int4,
    STORAGE = extended
);


ALTER TYPE public.ltree OWNER TO postgres;

--
-- TOC entry 2912 (class 0 OID 0)
-- Name: ltree_gist; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltree_gist;


--
-- TOC entry 1243 (class 1255 OID 85164)
-- Dependencies: 11 2912
-- Name: ltree_gist_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_gist_in(cstring) RETURNS ltree_gist
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltree_gist_in';


ALTER FUNCTION public.ltree_gist_in(cstring) OWNER TO postgres;

--
-- TOC entry 1244 (class 1255 OID 85165)
-- Dependencies: 11 2912
-- Name: ltree_gist_out(ltree_gist); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_gist_out(ltree_gist) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltree_gist_out';


ALTER FUNCTION public.ltree_gist_out(ltree_gist) OWNER TO postgres;

--
-- TOC entry 2911 (class 1247 OID 85163)
-- Dependencies: 1244 1243 11
-- Name: ltree_gist; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltree_gist (
    INTERNALLENGTH = variable,
    INPUT = ltree_gist_in,
    OUTPUT = ltree_gist_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.ltree_gist OWNER TO postgres;

--
-- TOC entry 2916 (class 0 OID 0)
-- Name: ltxtquery; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltxtquery;


--
-- TOC entry 1245 (class 1255 OID 85168)
-- Dependencies: 11 2916
-- Name: ltxtq_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltxtq_in(cstring) RETURNS ltxtquery
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltxtq_in';


ALTER FUNCTION public.ltxtq_in(cstring) OWNER TO postgres;

--
-- TOC entry 1246 (class 1255 OID 85169)
-- Dependencies: 11 2916
-- Name: ltxtq_out(ltxtquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltxtq_out(ltxtquery) RETURNS cstring
    LANGUAGE c STRICT
    AS '$libdir/ltree', 'ltxtq_out';


ALTER FUNCTION public.ltxtq_out(ltxtquery) OWNER TO postgres;

--
-- TOC entry 2915 (class 1247 OID 85167)
-- Dependencies: 1246 1245 11
-- Name: ltxtquery; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE ltxtquery (
    INTERNALLENGTH = variable,
    INPUT = ltxtq_in,
    OUTPUT = ltxtq_out,
    ALIGNMENT = int4,
    STORAGE = extended
);


ALTER TYPE public.ltxtquery OWNER TO postgres;

--
-- TOC entry 2899 (class 0 OID 0)
-- Name: query_int; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE query_int;


--
-- TOC entry 1247 (class 1255 OID 85172)
-- Dependencies: 11 2899
-- Name: bqarr_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bqarr_in(cstring) RETURNS query_int
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'bqarr_in';


ALTER FUNCTION public.bqarr_in(cstring) OWNER TO postgres;

--
-- TOC entry 1248 (class 1255 OID 85173)
-- Dependencies: 11 2899
-- Name: bqarr_out(query_int); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bqarr_out(query_int) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'bqarr_out';


ALTER FUNCTION public.bqarr_out(query_int) OWNER TO postgres;

--
-- TOC entry 2898 (class 1247 OID 85171)
-- Dependencies: 1248 1247 11
-- Name: query_int; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE query_int (
    INTERNALLENGTH = variable,
    INPUT = bqarr_in,
    OUTPUT = bqarr_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.query_int OWNER TO postgres;

--
-- TOC entry 2923 (class 0 OID 0)
-- Name: seg; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE seg;


--
-- TOC entry 1249 (class 1255 OID 85176)
-- Dependencies: 11 2923
-- Name: seg_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_in(cstring) RETURNS seg
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_in';


ALTER FUNCTION public.seg_in(cstring) OWNER TO postgres;

--
-- TOC entry 1250 (class 1255 OID 85177)
-- Dependencies: 11 2923
-- Name: seg_out(seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_out(seg) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_out';


ALTER FUNCTION public.seg_out(seg) OWNER TO postgres;

--
-- TOC entry 2922 (class 1247 OID 85175)
-- Dependencies: 1250 1249 11
-- Name: seg; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE seg (
    INTERNALLENGTH = 12,
    INPUT = seg_in,
    OUTPUT = seg_out,
    ALIGNMENT = int4,
    STORAGE = plain
);


ALTER TYPE public.seg OWNER TO postgres;

--
-- TOC entry 8884 (class 0 OID 0)
-- Dependencies: 2922
-- Name: TYPE seg; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE seg IS 'floating point interval ''FLOAT .. FLOAT'', ''.. FLOAT'', ''FLOAT ..'' or ''FLOAT''';


--
-- TOC entry 2919 (class 1247 OID 85181)
-- Dependencies: 11 323
-- Name: tablefunc_crosstab_2; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_2 AS (
	row_name text,
	category_1 text,
	category_2 text
);


ALTER TYPE public.tablefunc_crosstab_2 OWNER TO postgres;

--
-- TOC entry 2926 (class 1247 OID 85184)
-- Dependencies: 11 324
-- Name: tablefunc_crosstab_3; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_3 AS (
	row_name text,
	category_1 text,
	category_2 text,
	category_3 text
);


ALTER TYPE public.tablefunc_crosstab_3 OWNER TO postgres;

--
-- TOC entry 2929 (class 1247 OID 85187)
-- Dependencies: 11 325
-- Name: tablefunc_crosstab_4; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE tablefunc_crosstab_4 AS (
	row_name text,
	category_1 text,
	category_2 text,
	category_3 text,
	category_4 text
);


ALTER TYPE public.tablefunc_crosstab_4 OWNER TO postgres;

--
-- TOC entry 2933 (class 0 OID 0)
-- Name: upc; Type: SHELL TYPE; Schema: public; Owner: postgres
--

CREATE TYPE upc;


--
-- TOC entry 1251 (class 1255 OID 85189)
-- Dependencies: 11 2933
-- Name: isn_out(upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_out(upc) RETURNS cstring
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isn_out';


ALTER FUNCTION public.isn_out(upc) OWNER TO postgres;

--
-- TOC entry 1252 (class 1255 OID 85190)
-- Dependencies: 11 2933
-- Name: upc_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION upc_in(cstring) RETURNS upc
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'upc_in';


ALTER FUNCTION public.upc_in(cstring) OWNER TO postgres;

--
-- TOC entry 2932 (class 1247 OID 85188)
-- Dependencies: 1251 1252 11
-- Name: upc; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE upc (
    INTERNALLENGTH = 8,
    INPUT = upc_in,
    OUTPUT = public.isn_out,
    ALIGNMENT = double,
    STORAGE = plain
);


ALTER TYPE public.upc OWNER TO postgres;

--
-- TOC entry 8885 (class 0 OID 0)
-- Dependencies: 2932
-- Name: TYPE upc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TYPE upc IS 'Universal Product Code (UPC)';


--
-- TOC entry 1253 (class 1255 OID 85192)
-- Dependencies: 11
-- Name: _int_contained(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_contained(integer[], integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_contained';


ALTER FUNCTION public._int_contained(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 8886 (class 0 OID 0)
-- Dependencies: 1253
-- Name: FUNCTION _int_contained(integer[], integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION _int_contained(integer[], integer[]) IS 'contained in';


--
-- TOC entry 1254 (class 1255 OID 85193)
-- Dependencies: 11
-- Name: _int_contains(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_contains(integer[], integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_contains';


ALTER FUNCTION public._int_contains(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 8887 (class 0 OID 0)
-- Dependencies: 1254
-- Name: FUNCTION _int_contains(integer[], integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION _int_contains(integer[], integer[]) IS 'contains';


--
-- TOC entry 1255 (class 1255 OID 85194)
-- Dependencies: 11
-- Name: _int_different(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_different(integer[], integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_different';


ALTER FUNCTION public._int_different(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 8888 (class 0 OID 0)
-- Dependencies: 1255
-- Name: FUNCTION _int_different(integer[], integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION _int_different(integer[], integer[]) IS 'different';


--
-- TOC entry 1256 (class 1255 OID 85195)
-- Dependencies: 11
-- Name: _int_inter(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_inter(integer[], integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_inter';


ALTER FUNCTION public._int_inter(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 1257 (class 1255 OID 85196)
-- Dependencies: 11
-- Name: _int_overlap(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_overlap(integer[], integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_overlap';


ALTER FUNCTION public._int_overlap(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 8889 (class 0 OID 0)
-- Dependencies: 1257
-- Name: FUNCTION _int_overlap(integer[], integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION _int_overlap(integer[], integer[]) IS 'overlaps';


--
-- TOC entry 1258 (class 1255 OID 85197)
-- Dependencies: 11
-- Name: _int_same(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_same(integer[], integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_same';


ALTER FUNCTION public._int_same(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 8890 (class 0 OID 0)
-- Dependencies: 1258
-- Name: FUNCTION _int_same(integer[], integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION _int_same(integer[], integer[]) IS 'same as';


--
-- TOC entry 1259 (class 1255 OID 85198)
-- Dependencies: 11
-- Name: _int_union(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _int_union(integer[], integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', '_int_union';


ALTER FUNCTION public._int_union(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 1260 (class 1255 OID 85199)
-- Dependencies: 2907 2888 11
-- Name: _lt_q_regex(ltree[], lquery[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _lt_q_regex(ltree[], lquery[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_lt_q_regex';


ALTER FUNCTION public._lt_q_regex(ltree[], lquery[]) OWNER TO postgres;

--
-- TOC entry 1261 (class 1255 OID 85200)
-- Dependencies: 2888 2907 11
-- Name: _lt_q_rregex(lquery[], ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _lt_q_rregex(lquery[], ltree[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_lt_q_rregex';


ALTER FUNCTION public._lt_q_rregex(lquery[], ltree[]) OWNER TO postgres;

--
-- TOC entry 1262 (class 1255 OID 85201)
-- Dependencies: 2905 2888 2882 11
-- Name: _ltq_extract_regex(ltree[], lquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltq_extract_regex(ltree[], lquery) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltq_extract_regex';


ALTER FUNCTION public._ltq_extract_regex(ltree[], lquery) OWNER TO postgres;

--
-- TOC entry 1263 (class 1255 OID 85202)
-- Dependencies: 2905 2888 11
-- Name: _ltq_regex(ltree[], lquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltq_regex(ltree[], lquery) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltq_regex';


ALTER FUNCTION public._ltq_regex(ltree[], lquery) OWNER TO postgres;

--
-- TOC entry 1264 (class 1255 OID 85203)
-- Dependencies: 2888 2905 11
-- Name: _ltq_rregex(lquery, ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltq_rregex(lquery, ltree[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltq_rregex';


ALTER FUNCTION public._ltq_rregex(lquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 1265 (class 1255 OID 85204)
-- Dependencies: 11
-- Name: _ltree_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', '_ltree_compress';


ALTER FUNCTION public._ltree_compress(internal) OWNER TO postgres;

--
-- TOC entry 1266 (class 1255 OID 85205)
-- Dependencies: 11
-- Name: _ltree_consistent(internal, internal, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_consistent(internal, internal, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', '_ltree_consistent';


ALTER FUNCTION public._ltree_consistent(internal, internal, smallint) OWNER TO postgres;

--
-- TOC entry 1267 (class 1255 OID 85206)
-- Dependencies: 2882 2888 2882 11
-- Name: _ltree_extract_isparent(ltree[], ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_extract_isparent(ltree[], ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_extract_isparent';


ALTER FUNCTION public._ltree_extract_isparent(ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 1268 (class 1255 OID 85207)
-- Dependencies: 2882 2888 2882 11
-- Name: _ltree_extract_risparent(ltree[], ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_extract_risparent(ltree[], ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_extract_risparent';


ALTER FUNCTION public._ltree_extract_risparent(ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 1269 (class 1255 OID 85208)
-- Dependencies: 2882 2888 11
-- Name: _ltree_isparent(ltree[], ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_isparent(ltree[], ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_isparent';


ALTER FUNCTION public._ltree_isparent(ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 1270 (class 1255 OID 85209)
-- Dependencies: 11
-- Name: _ltree_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_penalty';


ALTER FUNCTION public._ltree_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1271 (class 1255 OID 85210)
-- Dependencies: 11
-- Name: _ltree_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', '_ltree_picksplit';


ALTER FUNCTION public._ltree_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1272 (class 1255 OID 85211)
-- Dependencies: 2888 2882 11
-- Name: _ltree_r_isparent(ltree, ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_r_isparent(ltree, ltree[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_r_isparent';


ALTER FUNCTION public._ltree_r_isparent(ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 1273 (class 1255 OID 85212)
-- Dependencies: 2888 2882 11
-- Name: _ltree_r_risparent(ltree, ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_r_risparent(ltree, ltree[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_r_risparent';


ALTER FUNCTION public._ltree_r_risparent(ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 1274 (class 1255 OID 85213)
-- Dependencies: 2882 2888 11
-- Name: _ltree_risparent(ltree[], ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_risparent(ltree[], ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltree_risparent';


ALTER FUNCTION public._ltree_risparent(ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 1275 (class 1255 OID 85214)
-- Dependencies: 11
-- Name: _ltree_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', '_ltree_same';


ALTER FUNCTION public._ltree_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1276 (class 1255 OID 85215)
-- Dependencies: 11
-- Name: _ltree_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltree_union(internal, internal) RETURNS integer
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', '_ltree_union';


ALTER FUNCTION public._ltree_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1277 (class 1255 OID 85216)
-- Dependencies: 2915 2888 11
-- Name: _ltxtq_exec(ltree[], ltxtquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltxtq_exec(ltree[], ltxtquery) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltxtq_exec';


ALTER FUNCTION public._ltxtq_exec(ltree[], ltxtquery) OWNER TO postgres;

--
-- TOC entry 1278 (class 1255 OID 85217)
-- Dependencies: 2915 2888 2882 11
-- Name: _ltxtq_extract_exec(ltree[], ltxtquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltxtq_extract_exec(ltree[], ltxtquery) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltxtq_extract_exec';


ALTER FUNCTION public._ltxtq_extract_exec(ltree[], ltxtquery) OWNER TO postgres;

--
-- TOC entry 1279 (class 1255 OID 85218)
-- Dependencies: 2888 2915 11
-- Name: _ltxtq_rexec(ltxtquery, ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION _ltxtq_rexec(ltxtquery, ltree[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_ltxtq_rexec';


ALTER FUNCTION public._ltxtq_rexec(ltxtquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 1280 (class 1255 OID 85219)
-- Dependencies: 4822 11
-- Name: accesobloque_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION accesobloque_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO accesobloque_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO accesobloque_audit SELECT 'U', now(),  NEW.*;
            INSERT INTO accesobloque_audit SELECT 'X', now(),  OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO accesobloque_audit SELECT 'I', now(),  NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.accesobloque_audit_fun() OWNER TO postgres;

--
-- TOC entry 8891 (class 0 OID 0)
-- Dependencies: 1280
-- Name: FUNCTION accesobloque_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION accesobloque_audit_fun() IS 'Tabla acceso bloque';


--
-- TOC entry 1281 (class 1255 OID 85220)
-- Dependencies: 4822 11
-- Name: acta_asignacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION acta_asignacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO acta_asignacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO acta_asignacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO acta_asignacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO acta_asignacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.acta_asignacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1282 (class 1255 OID 85221)
-- Dependencies: 4822 11
-- Name: actareasignacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION actareasignacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO actareasignacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO actareasignacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO actareasignacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO actareasignacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.actareasignacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1283 (class 1255 OID 85222)
-- Dependencies: 4822 11
-- Name: actividadfuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION actividadfuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO actividadfuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO actividadfuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO actividadfuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO actividadfuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.actividadfuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1300 (class 1255 OID 85223)
-- Dependencies: 4822 11
-- Name: actuacionhistoricoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION actuacionhistoricoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO actuacionhistoricoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO actuacionhistoricoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO actuacionhistoricoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO actuacionhistoricoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.actuacionhistoricoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 1301 (class 1255 OID 85224)
-- Dependencies: 4822 11
-- Name: actualizarorigencarpeta_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION actualizarorigencarpeta_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$

-- VERSION: 1.0
-- AUTOR: JIMMY ALEXANDER CRUZ QUINTERO
-- FGN - UNJYP
-- 2009-12-22
-- BOGOTA - COLOMBIA

DECLARE
        var_idcarpeta1         integer;
        var_idcarpeta2         integer;
BEGIN
                IF (TG_OP = 'INSERT') THEN
                               var_idcarpeta1 := NEW.idcarpetahecho;
                               PERFORM set_origen_carpeta(var_idcarpeta1, NEW.usuario);
                               RETURN NEW;
        ELSIF (TG_OP = 'UPDATE') THEN
                               var_idcarpeta1 := NEW.idcarpetahecho;
                               var_idcarpeta2 := OLD.idcarpetahecho;
                               PERFORM set_origen_carpeta(var_idcarpeta1, NEW.usuario);
                               PERFORM set_origen_carpeta(var_idcarpeta2, NEW.usuario);
                               RETURN NEW;
        ELSIF (TG_OP = 'DELETE') THEN
                               var_idcarpeta1 := OLD.idcarpetahecho;
                               PERFORM set_origen_carpeta(var_idcarpeta1, OLD.usuario);
                               RETURN OLD;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
END;
$$;


ALTER FUNCTION public.actualizarorigencarpeta_fun() OWNER TO postgres;

--
-- TOC entry 1302 (class 1255 OID 85225)
-- Dependencies: 2859 11
-- Name: akeys(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION akeys(hstore) RETURNS text[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'akeys';


ALTER FUNCTION public.akeys(hstore) OWNER TO postgres;

--
-- TOC entry 1303 (class 1255 OID 85226)
-- Dependencies: 4822 11
-- Name: albumfotografico_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION albumfotografico_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO albumfotografico_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO albumfotografico_audit SELECT 'U', now(), NEW.*;
            INSERT INTO albumfotografico_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO albumfotografico_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.albumfotografico_audit_fun() OWNER TO postgres;

--
-- TOC entry 1304 (class 1255 OID 85227)
-- Dependencies: 4822 11
-- Name: albumfotograficodownload_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION albumfotograficodownload_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO albumfotograficodownload_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO albumfotograficodownload_audit SELECT 'U', now(), NEW.*;
            INSERT INTO albumfotograficodownload_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO albumfotograficodownload_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.albumfotograficodownload_audit_fun() OWNER TO postgres;

--
-- TOC entry 1324 (class 1255 OID 85228)
-- Dependencies: 4822 11
-- Name: apelacionterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION apelacionterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO apelacionterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO apelacionterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO apelacionterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO apelacionterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.apelacionterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1325 (class 1255 OID 85229)
-- Dependencies: 4822 11
-- Name: apoderado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION apoderado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO apoderado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO apoderado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO apoderado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO apoderado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.apoderado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1326 (class 1255 OID 85230)
-- Dependencies: 11
-- Name: armor(bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION armor(bytea) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_armor';


ALTER FUNCTION public.armor(bytea) OWNER TO postgres;

--
-- TOC entry 1327 (class 1255 OID 85231)
-- Dependencies: 4822 11
-- Name: asignaciongrupoarmado(integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION asignaciongrupoarmado(integer, text) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
-- datos de entrada  idasignaciongrupoarmado, usuario

DECLARE
seejecuto boolean;
cons  record;
BEGIN
seejecuto:= false;

--Genero la consulta

FOR cons IN

SELECT  fiscal, despacho, idgrupoarmado, idestructura, idbloque, idfrente, public.resolucionasignacion.fecha as fecha
FROM    asignaciongrupoarmado INNER JOIN public.resolucionasignacion ON (asignaciongrupoarmado.idresolucionasignacion = public.resolucionasignacion.idresolucionasignacion)
WHERE idasignaciongrupoarmado = $1 AND estado

--Ingreso los datos
LOOP
if(cons.fiscal is not null) then

-- ACTUALIZO POSTULADOS


-- INGRESO EN LA TABLA historicopostuladoasignaciongrupoarmado

INSERT INTO public.historicopostuladoasignaciongrupoarmado( idasignaciongrupoarmado, radicado, fecha, usuario)
SELECT DISTINCT  $1,p.r, cast(cons.fecha as date), $5  from
(SELECT postuladoasignacion.radicado as r
FROM   postuladoasignacion 
             WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		 idbloque = cons.idbloque AND idfrente = cons.idfrente 
union all
SELECT postulado.radicado FROM  postulado  
				WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		                        idbloque = cons.idbloque AND idfrente = cons.idfrente ) as p;


   -- TABLA postuladoasignacion 

	UPDATE postuladoasignacion SET   fiscal = cons.fiscal, despacho = cons.despacho, usuario = $2
	WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		 idbloque = cons.idbloque AND idfrente = cons.idfrente ;

  -- TABLA postulado
  
	UPDATE postulado SET   fiscal = cons.fiscal, despacho = cons.despacho, usuario = $2 
	WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		 idbloque = cons.idbloque AND idfrente = cons.idfrente ;


seejecuto:= true;      
end if;

END LOOP;
   
RETURN seejecuto;

END
$_$;


ALTER FUNCTION public.asignaciongrupoarmado(integer, text) OWNER TO postgres;

--
-- TOC entry 1328 (class 1255 OID 85232)
-- Dependencies: 4822 11
-- Name: asignaciongrupoarmado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION asignaciongrupoarmado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO asignaciongrupoarmado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO asignaciongrupoarmado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO asignaciongrupoarmado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO asignaciongrupoarmado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.asignaciongrupoarmado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1329 (class 1255 OID 85233)
-- Dependencies: 4822 11
-- Name: asignacionpostulados_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION asignacionpostulados_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
	IF (TG_OP = 'UPDATE' ) THEN
		IF (OLD.fechaasignacion IS NULL AND NOT NEW.fechaasignacion IS NULL) THEN
			INSERT INTO public.asignacionpostulados(fechaactualizacion,radicado,fiscal,despacho,fechaasignacion,idetapaproceso,idsede,
								idgrupoarmado,idestructura,idbloque,idfrente,usuario)
				VALUES(NOW(),NEW.radicado,NEW.fiscal,NEW.despacho,NEW.fechaasignacion,NEW.idetapaproceso,NEW.idsede,
				       NEW.idgrupoarmado,NEW.idestructura,NEW.idbloque,NEW.idfrente,NEW.usuario);
			RETURN NEW;			
		END IF;       
	END IF;	
	RETURN NULL;
END;
$$;


ALTER FUNCTION public.asignacionpostulados_fun() OWNER TO postgres;

--
-- TOC entry 1330 (class 1255 OID 85234)
-- Dependencies: 4822 11
-- Name: audiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION audiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO audiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO audiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO audiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO audiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.audiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 1331 (class 1255 OID 85235)
-- Dependencies: 11
-- Name: autoinc(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION autoinc() RETURNS trigger
    LANGUAGE c
    AS '$libdir/autoinc', 'autoinc';


ALTER FUNCTION public.autoinc() OWNER TO postgres;

--
-- TOC entry 1332 (class 1255 OID 85236)
-- Dependencies: 2859 11
-- Name: avals(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION avals(hstore) RETURNS text[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'avals';


ALTER FUNCTION public.avals(hstore) OWNER TO postgres;

--
-- TOC entry 1333 (class 1255 OID 85237)
-- Dependencies: 4822 11
-- Name: bien_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bien_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO bien_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO bien_audit SELECT 'U', now(), NEW.*;
            INSERT INTO bien_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO bien_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.bien_audit_fun() OWNER TO postgres;

--
-- TOC entry 1334 (class 1255 OID 85238)
-- Dependencies: 4822 11
-- Name: bienesentregadosdesmovilizacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bienesentregadosdesmovilizacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO bienesentregadosdesmovilizacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO bienesentregadosdesmovilizacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO bienesentregadosdesmovilizacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO bienesentregadosdesmovilizacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.bienesentregadosdesmovilizacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8892 (class 0 OID 0)
-- Dependencies: 1334
-- Name: FUNCTION bienesentregadosdesmovilizacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION bienesentregadosdesmovilizacion_audit_fun() IS 'bienes entregados desmovilizacion';


--
-- TOC entry 1335 (class 1255 OID 85239)
-- Dependencies: 2898 11
-- Name: boolop(integer[], query_int); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION boolop(integer[], query_int) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'boolop';


ALTER FUNCTION public.boolop(integer[], query_int) OWNER TO postgres;

--
-- TOC entry 8893 (class 0 OID 0)
-- Dependencies: 1335
-- Name: FUNCTION boolop(integer[], query_int); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION boolop(integer[], query_int) IS 'boolean operation with array';


--
-- TOC entry 1336 (class 1255 OID 85240)
-- Dependencies: 11
-- Name: bt_metap(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bt_metap(relname text, OUT magic integer, OUT version integer, OUT root integer, OUT level integer, OUT fastroot integer, OUT fastlevel integer) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'bt_metap';


ALTER FUNCTION public.bt_metap(relname text, OUT magic integer, OUT version integer, OUT root integer, OUT level integer, OUT fastroot integer, OUT fastlevel integer) OWNER TO postgres;

--
-- TOC entry 1339 (class 1255 OID 85241)
-- Dependencies: 11
-- Name: bt_page_items(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bt_page_items(relname text, blkno integer, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'bt_page_items';


ALTER FUNCTION public.bt_page_items(relname text, blkno integer, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text) OWNER TO postgres;

--
-- TOC entry 1340 (class 1255 OID 85242)
-- Dependencies: 11
-- Name: bt_page_stats(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION bt_page_stats(relname text, blkno integer, OUT blkno integer, OUT type "char", OUT live_items integer, OUT dead_items integer, OUT avg_item_size integer, OUT page_size integer, OUT free_size integer, OUT btpo_prev integer, OUT btpo_next integer, OUT btpo integer, OUT btpo_flags integer) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'bt_page_stats';


ALTER FUNCTION public.bt_page_stats(relname text, blkno integer, OUT blkno integer, OUT type "char", OUT live_items integer, OUT dead_items integer, OUT avg_item_size integer, OUT page_size integer, OUT free_size integer, OUT btpo_prev integer, OUT btpo_next integer, OUT btpo integer, OUT btpo_flags integer) OWNER TO postgres;

--
-- TOC entry 1341 (class 1255 OID 85243)
-- Dependencies: 2823 2823 11
-- Name: btean13cmp(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1342 (class 1255 OID 85244)
-- Dependencies: 2863 2823 11
-- Name: btean13cmp(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, isbn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1343 (class 1255 OID 85245)
-- Dependencies: 2867 2823 11
-- Name: btean13cmp(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, isbn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1344 (class 1255 OID 85246)
-- Dependencies: 2884 2823 11
-- Name: btean13cmp(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, ismn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1345 (class 1255 OID 85247)
-- Dependencies: 2890 2823 11
-- Name: btean13cmp(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, ismn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1346 (class 1255 OID 85248)
-- Dependencies: 2894 2823 11
-- Name: btean13cmp(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, issn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1347 (class 1255 OID 85249)
-- Dependencies: 2900 2823 11
-- Name: btean13cmp(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, issn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1348 (class 1255 OID 85250)
-- Dependencies: 2932 2823 11
-- Name: btean13cmp(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btean13cmp(ean13, upc) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btean13cmp(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1349 (class 1255 OID 85251)
-- Dependencies: 2823 2867 11
-- Name: btisbn13cmp(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbn13cmp(isbn13, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbn13cmp(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1350 (class 1255 OID 85252)
-- Dependencies: 2863 2867 11
-- Name: btisbn13cmp(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbn13cmp(isbn13, isbn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbn13cmp(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1351 (class 1255 OID 85253)
-- Dependencies: 2867 2867 11
-- Name: btisbn13cmp(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbn13cmp(isbn13, isbn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbn13cmp(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1352 (class 1255 OID 85254)
-- Dependencies: 2823 2863 11
-- Name: btisbncmp(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbncmp(isbn, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbncmp(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1353 (class 1255 OID 85255)
-- Dependencies: 2863 2863 11
-- Name: btisbncmp(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbncmp(isbn, isbn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbncmp(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1354 (class 1255 OID 85256)
-- Dependencies: 2867 2863 11
-- Name: btisbncmp(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btisbncmp(isbn, isbn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btisbncmp(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1355 (class 1255 OID 85257)
-- Dependencies: 2823 2890 11
-- Name: btismn13cmp(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismn13cmp(ismn13, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismn13cmp(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1356 (class 1255 OID 85258)
-- Dependencies: 2884 2890 11
-- Name: btismn13cmp(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismn13cmp(ismn13, ismn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismn13cmp(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1357 (class 1255 OID 85259)
-- Dependencies: 2890 2890 11
-- Name: btismn13cmp(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismn13cmp(ismn13, ismn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismn13cmp(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1358 (class 1255 OID 85260)
-- Dependencies: 2823 2884 11
-- Name: btismncmp(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismncmp(ismn, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismncmp(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1359 (class 1255 OID 85261)
-- Dependencies: 2884 2884 11
-- Name: btismncmp(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismncmp(ismn, ismn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismncmp(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1360 (class 1255 OID 85262)
-- Dependencies: 2890 2884 11
-- Name: btismncmp(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btismncmp(ismn, ismn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btismncmp(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1361 (class 1255 OID 85263)
-- Dependencies: 2823 2900 11
-- Name: btissn13cmp(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissn13cmp(issn13, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissn13cmp(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1362 (class 1255 OID 85264)
-- Dependencies: 2894 2900 11
-- Name: btissn13cmp(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissn13cmp(issn13, issn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissn13cmp(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1363 (class 1255 OID 85265)
-- Dependencies: 2900 2900 11
-- Name: btissn13cmp(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissn13cmp(issn13, issn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissn13cmp(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1364 (class 1255 OID 85266)
-- Dependencies: 2823 2894 11
-- Name: btissncmp(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissncmp(issn, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissncmp(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1365 (class 1255 OID 85267)
-- Dependencies: 2894 2894 11
-- Name: btissncmp(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissncmp(issn, issn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissncmp(issn, issn) OWNER TO postgres;

--
-- TOC entry 1366 (class 1255 OID 85268)
-- Dependencies: 2900 2894 11
-- Name: btissncmp(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btissncmp(issn, issn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btissncmp(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1367 (class 1255 OID 85269)
-- Dependencies: 2823 2932 11
-- Name: btupccmp(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btupccmp(upc, ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btupccmp(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1368 (class 1255 OID 85270)
-- Dependencies: 2932 2932 11
-- Name: btupccmp(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION btupccmp(upc, upc) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$btint8cmp$$;


ALTER FUNCTION public.btupccmp(upc, upc) OWNER TO postgres;

--
-- TOC entry 1369 (class 1255 OID 85271)
-- Dependencies: 4822 11
-- Name: cambiadelitoprincipal0(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cambiadelitoprincipal0() RETURNS character varying
    LANGUAGE plpgsql
    AS $$

DECLARE
actualizar RECORD;
contador integer;
BEGIN
contador := 0;
for actualizar in SELECT public.evento.idevento, Max(public.hecho.iddelito) AS maxDeiddelito
FROM public.evento INNER JOIN public.hecho ON public.evento.idevento=public.hecho.idevento
GROUP BY public.evento.idevento, public.evento.idorigenevento, public.hecho.idhecho, public.evento.delitoprincipal
HAVING public.evento.idorigenevento=1 AND public.evento.delitoprincipal=0 LOOP

UPDATE  evento
SET delitoprincipal = actualizar.maxDeiddelito
where idevento = actualizar.idevento;
contador = contador+1;
END LOOP;


RETURN 'Se actualizaron ' || CAST(contador AS text) || ' eventos.';
END
$$;


ALTER FUNCTION public.cambiadelitoprincipal0() OWNER TO postgres;

--
-- TOC entry 1374 (class 1255 OID 85272)
-- Dependencies: 4822 11
-- Name: cambiaestadosentencia(character varying, integer, date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cambiaestadosentencia(character varying, integer, date) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE
sentencia RECORD;
id INTEGER;
contador integer;
BEGIN
contador := 0;
FOR sentencia IN SELECT S.radicado,S.idaudiencia FROM PUBLIC.SENTENCIAJYP S WHERE S.radicado = $1 AND S.idaudiencia = $2 LOOP
SELECT idaudiencia INTO id  FROM PUBLIC.AUDIENCIA WHERE idaudiencia = sentencia.idaudiencia AND fechaarealizar > $3;
UPDATE PUBLIC.SENTENCIAJYP SET sentenciadefinitiva = FALSE WHERE radicado = sentencia.radicado AND idaudiencia = id;
contador :=contador+1;
END LOOP;
RETURN 'Se actualizaron ' || CAST(contador AS text) || ' sentencias.';
END
$_$;


ALTER FUNCTION public.cambiaestadosentencia(character varying, integer, date) OWNER TO postgres;

--
-- TOC entry 1375 (class 1255 OID 85273)
-- Dependencies: 4822 11
-- Name: cambiaestadosentenciaanteriores(character varying, date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cambiaestadosentenciaanteriores(character varying, date) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE
sentencia RECORD;
id INTEGER;
contador integer;
BEGIN
contador := 0;
FOR sentencia IN SELECT S.radicado,S.idaudiencia FROM PUBLIC.SENTENCIAJYP S WHERE S.radicado = $1 LOOP
SELECT idaudiencia INTO id  FROM PUBLIC.AUDIENCIA WHERE idaudiencia = sentencia.idaudiencia AND fechaarealizar < $2;
UPDATE PUBLIC.SENTENCIAJYP SET sentenciadefinitiva = FALSE WHERE radicado = sentencia.radicado AND idaudiencia = id;
contador :=contador+1;
END LOOP;
RETURN 'Se actualizaron ' || CAST(contador AS text) || ' sentencias.';
END
$_$;


ALTER FUNCTION public.cambiaestadosentenciaanteriores(character varying, date) OWNER TO postgres;

--
-- TOC entry 1376 (class 1255 OID 85274)
-- Dependencies: 4822 11
-- Name: caracteristica_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION caracteristica_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO caracteristica_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO caracteristica_audit SELECT 'U', now(), NEW.*;
            INSERT INTO caracteristica_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO caracteristica_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.caracteristica_audit_fun() OWNER TO postgres;

--
-- TOC entry 8894 (class 0 OID 0)
-- Dependencies: 1376
-- Name: FUNCTION caracteristica_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION caracteristica_audit_fun() IS 'Caracteristicas del bien';


--
-- TOC entry 1377 (class 1255 OID 85275)
-- Dependencies: 4822 11
-- Name: carpetahecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION carpetahecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO carpetahecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO carpetahecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO carpetahecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO carpetahecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.carpetahecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 1378 (class 1255 OID 85276)
-- Dependencies: 4822 11
-- Name: causaterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION causaterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO causaterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO causaterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO causaterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO causaterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.causaterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1379 (class 1255 OID 85277)
-- Dependencies: 11
-- Name: check_foreign_key(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION check_foreign_key() RETURNS trigger
    LANGUAGE c
    AS '$libdir/refint', 'check_foreign_key';


ALTER FUNCTION public.check_foreign_key() OWNER TO postgres;

--
-- TOC entry 1380 (class 1255 OID 85278)
-- Dependencies: 11
-- Name: check_primary_key(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION check_primary_key() RETURNS trigger
    LANGUAGE c
    AS '$libdir/refint', 'check_primary_key';


ALTER FUNCTION public.check_primary_key() OWNER TO postgres;

--
-- TOC entry 1381 (class 1255 OID 85279)
-- Dependencies: 4822 11
-- Name: clasedesmovilizacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION clasedesmovilizacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO clasedesmovilizacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO clasedesmovilizacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO clasedesmovilizacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO clasedesmovilizacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.clasedesmovilizacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1382 (class 1255 OID 85280)
-- Dependencies: 4822 11
-- Name: compulsacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION compulsacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO compulsacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO compulsacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO compulsacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO compulsacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.compulsacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1393 (class 1255 OID 85281)
-- Dependencies: 11
-- Name: concat_fecha(character varying, date, date, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION concat_fecha(character varying, date, date, character varying) RETURNS character varying
    LANGUAGE sql IMMUTABLE
    AS $_$
	SELECT
				CASE
					WHEN LENGTH(TRIM($1)) != 0 THEN UPPER(TRIM($1))
				ELSE '' END ||
				CASE
					WHEN NOT $2 IS NULL THEN ' - ' || $2
				ELSE '' END ||

				CASE
					WHEN NOT $3 IS NULL  THEN ' - ' || $3
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($4)) != 0 THEN ' - ' || UPPER(TRIM($4))
				ELSE '' END			
			
$_$;


ALTER FUNCTION public.concat_fecha(character varying, date, date, character varying) OWNER TO postgres;

--
-- TOC entry 1394 (class 1255 OID 85282)
-- Dependencies: 11
-- Name: connectby(text, text, text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text';


ALTER FUNCTION public.connectby(text, text, text, text, integer) OWNER TO postgres;

--
-- TOC entry 1395 (class 1255 OID 85283)
-- Dependencies: 11
-- Name: connectby(text, text, text, text, integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, integer, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text';


ALTER FUNCTION public.connectby(text, text, text, text, integer, text) OWNER TO postgres;

--
-- TOC entry 1396 (class 1255 OID 85284)
-- Dependencies: 11
-- Name: connectby(text, text, text, text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text_serial';


ALTER FUNCTION public.connectby(text, text, text, text, text, integer) OWNER TO postgres;

--
-- TOC entry 1397 (class 1255 OID 85285)
-- Dependencies: 11
-- Name: connectby(text, text, text, text, text, integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connectby(text, text, text, text, text, integer, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'connectby_text_serial';


ALTER FUNCTION public.connectby(text, text, text, text, text, integer, text) OWNER TO postgres;

--
-- TOC entry 1398 (class 1255 OID 85286)
-- Dependencies: 4822 11
-- Name: connotacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION connotacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO connotacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO connotacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO connotacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO connotacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.connotacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8895 (class 0 OID 0)
-- Dependencies: 1398
-- Name: FUNCTION connotacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION connotacion_audit_fun() IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 1399 (class 1255 OID 85287)
-- Dependencies: 4822 11
-- Name: controlregistrohechos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION controlregistrohechos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO controlregistrohechos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO controlregistrohechos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO controlregistrohechos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO controlregistrohechos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.controlregistrohechos_audit_fun() OWNER TO postgres;

--
-- TOC entry 8896 (class 0 OID 0)
-- Dependencies: 1399
-- Name: FUNCTION controlregistrohechos_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION controlregistrohechos_audit_fun() IS 'controlregistrohechos_trigger_fun';


--
-- TOC entry 1400 (class 1255 OID 85288)
-- Dependencies: 11
-- Name: crosstab(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab(text) OWNER TO postgres;

--
-- TOC entry 1401 (class 1255 OID 85289)
-- Dependencies: 11
-- Name: crosstab(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text, integer) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab(text, integer) OWNER TO postgres;

--
-- TOC entry 1402 (class 1255 OID 85290)
-- Dependencies: 11
-- Name: crosstab(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab(text, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab_hash';


ALTER FUNCTION public.crosstab(text, text) OWNER TO postgres;

--
-- TOC entry 1403 (class 1255 OID 85291)
-- Dependencies: 2919 11
-- Name: crosstab2(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab2(text) RETURNS SETOF tablefunc_crosstab_2
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab2(text) OWNER TO postgres;

--
-- TOC entry 1404 (class 1255 OID 85292)
-- Dependencies: 2926 11
-- Name: crosstab3(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab3(text) RETURNS SETOF tablefunc_crosstab_3
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab3(text) OWNER TO postgres;

--
-- TOC entry 1405 (class 1255 OID 85293)
-- Dependencies: 2929 11
-- Name: crosstab4(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crosstab4(text) RETURNS SETOF tablefunc_crosstab_4
    LANGUAGE c STABLE STRICT
    AS '$libdir/tablefunc', 'crosstab';


ALTER FUNCTION public.crosstab4(text) OWNER TO postgres;

--
-- TOC entry 1406 (class 1255 OID 85294)
-- Dependencies: 11
-- Name: crypt(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION crypt(text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_crypt';


ALTER FUNCTION public.crypt(text, text) OWNER TO postgres;

--
-- TOC entry 1407 (class 1255 OID 85295)
-- Dependencies: 2816 11
-- Name: cube(double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(double precision) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_f8';


ALTER FUNCTION public.cube(double precision) OWNER TO postgres;

--
-- TOC entry 1408 (class 1255 OID 85296)
-- Dependencies: 2816 11
-- Name: cube(double precision[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(double precision[]) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_a_f8';


ALTER FUNCTION public.cube(double precision[]) OWNER TO postgres;

--
-- TOC entry 1409 (class 1255 OID 85297)
-- Dependencies: 2816 11
-- Name: cube(double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(double precision, double precision) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_f8_f8';


ALTER FUNCTION public.cube(double precision, double precision) OWNER TO postgres;

--
-- TOC entry 1410 (class 1255 OID 85298)
-- Dependencies: 2816 11
-- Name: cube(double precision[], double precision[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(double precision[], double precision[]) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_a_f8_f8';


ALTER FUNCTION public.cube(double precision[], double precision[]) OWNER TO postgres;

--
-- TOC entry 1411 (class 1255 OID 85299)
-- Dependencies: 2816 2816 11
-- Name: cube(cube, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(cube, double precision) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_c_f8';


ALTER FUNCTION public.cube(cube, double precision) OWNER TO postgres;

--
-- TOC entry 1412 (class 1255 OID 85300)
-- Dependencies: 2816 2816 11
-- Name: cube(cube, double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube(cube, double precision, double precision) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_c_f8_f8';


ALTER FUNCTION public.cube(cube, double precision, double precision) OWNER TO postgres;

--
-- TOC entry 1413 (class 1255 OID 85301)
-- Dependencies: 2816 2816 11
-- Name: cube_cmp(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_cmp(cube, cube) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_cmp';


ALTER FUNCTION public.cube_cmp(cube, cube) OWNER TO postgres;

--
-- TOC entry 8897 (class 0 OID 0)
-- Dependencies: 1413
-- Name: FUNCTION cube_cmp(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_cmp(cube, cube) IS 'btree comparison function';


--
-- TOC entry 1414 (class 1255 OID 85302)
-- Dependencies: 2816 2816 11
-- Name: cube_contained(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_contained(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_contained';


ALTER FUNCTION public.cube_contained(cube, cube) OWNER TO postgres;

--
-- TOC entry 8898 (class 0 OID 0)
-- Dependencies: 1414
-- Name: FUNCTION cube_contained(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_contained(cube, cube) IS 'contained in';


--
-- TOC entry 1415 (class 1255 OID 85303)
-- Dependencies: 2816 2816 11
-- Name: cube_contains(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_contains(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_contains';


ALTER FUNCTION public.cube_contains(cube, cube) OWNER TO postgres;

--
-- TOC entry 8899 (class 0 OID 0)
-- Dependencies: 1415
-- Name: FUNCTION cube_contains(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_contains(cube, cube) IS 'contains';


--
-- TOC entry 1416 (class 1255 OID 85304)
-- Dependencies: 2816 2816 11
-- Name: cube_enlarge(cube, double precision, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_enlarge(cube, double precision, integer) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_enlarge';


ALTER FUNCTION public.cube_enlarge(cube, double precision, integer) OWNER TO postgres;

--
-- TOC entry 1417 (class 1255 OID 85305)
-- Dependencies: 2816 2816 11
-- Name: cube_eq(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_eq(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_eq';


ALTER FUNCTION public.cube_eq(cube, cube) OWNER TO postgres;

--
-- TOC entry 8900 (class 0 OID 0)
-- Dependencies: 1417
-- Name: FUNCTION cube_eq(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_eq(cube, cube) IS 'same as';


--
-- TOC entry 1418 (class 1255 OID 85306)
-- Dependencies: 2816 2816 11
-- Name: cube_ge(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_ge(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_ge';


ALTER FUNCTION public.cube_ge(cube, cube) OWNER TO postgres;

--
-- TOC entry 8901 (class 0 OID 0)
-- Dependencies: 1418
-- Name: FUNCTION cube_ge(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_ge(cube, cube) IS 'greater than or equal to';


--
-- TOC entry 1419 (class 1255 OID 85307)
-- Dependencies: 2816 2816 11
-- Name: cube_gt(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_gt(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_gt';


ALTER FUNCTION public.cube_gt(cube, cube) OWNER TO postgres;

--
-- TOC entry 8902 (class 0 OID 0)
-- Dependencies: 1419
-- Name: FUNCTION cube_gt(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_gt(cube, cube) IS 'greater than';


--
-- TOC entry 1420 (class 1255 OID 85308)
-- Dependencies: 2816 2816 2816 11
-- Name: cube_inter(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_inter(cube, cube) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_inter';


ALTER FUNCTION public.cube_inter(cube, cube) OWNER TO postgres;

--
-- TOC entry 1421 (class 1255 OID 85309)
-- Dependencies: 2816 2816 11
-- Name: cube_le(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_le(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_le';


ALTER FUNCTION public.cube_le(cube, cube) OWNER TO postgres;

--
-- TOC entry 8903 (class 0 OID 0)
-- Dependencies: 1421
-- Name: FUNCTION cube_le(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_le(cube, cube) IS 'lower than or equal to';


--
-- TOC entry 1422 (class 1255 OID 85310)
-- Dependencies: 2816 11
-- Name: cube_ll_coord(cube, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_ll_coord(cube, integer) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_ll_coord';


ALTER FUNCTION public.cube_ll_coord(cube, integer) OWNER TO postgres;

--
-- TOC entry 1423 (class 1255 OID 85311)
-- Dependencies: 2816 2816 11
-- Name: cube_lt(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_lt(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_lt';


ALTER FUNCTION public.cube_lt(cube, cube) OWNER TO postgres;

--
-- TOC entry 8904 (class 0 OID 0)
-- Dependencies: 1423
-- Name: FUNCTION cube_lt(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_lt(cube, cube) IS 'lower than';


--
-- TOC entry 1284 (class 1255 OID 85312)
-- Dependencies: 2816 2816 11
-- Name: cube_ne(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_ne(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_ne';


ALTER FUNCTION public.cube_ne(cube, cube) OWNER TO postgres;

--
-- TOC entry 8905 (class 0 OID 0)
-- Dependencies: 1284
-- Name: FUNCTION cube_ne(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_ne(cube, cube) IS 'different';


--
-- TOC entry 1285 (class 1255 OID 85313)
-- Dependencies: 2816 2816 11
-- Name: cube_overlap(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_overlap(cube, cube) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_overlap';


ALTER FUNCTION public.cube_overlap(cube, cube) OWNER TO postgres;

--
-- TOC entry 8906 (class 0 OID 0)
-- Dependencies: 1285
-- Name: FUNCTION cube_overlap(cube, cube); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION cube_overlap(cube, cube) IS 'overlaps';


--
-- TOC entry 1286 (class 1255 OID 85314)
-- Dependencies: 2816 11
-- Name: cube_size(cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_size(cube) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_size';


ALTER FUNCTION public.cube_size(cube) OWNER TO postgres;

--
-- TOC entry 1287 (class 1255 OID 85315)
-- Dependencies: 2816 2816 11
-- Name: cube_subset(cube, integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_subset(cube, integer[]) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_subset';


ALTER FUNCTION public.cube_subset(cube, integer[]) OWNER TO postgres;

--
-- TOC entry 1288 (class 1255 OID 85316)
-- Dependencies: 2816 2816 2816 11
-- Name: cube_union(cube, cube); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_union(cube, cube) RETURNS cube
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_union';


ALTER FUNCTION public.cube_union(cube, cube) OWNER TO postgres;

--
-- TOC entry 1289 (class 1255 OID 85317)
-- Dependencies: 2816 11
-- Name: cube_ur_coord(cube, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cube_ur_coord(cube, integer) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'cube_ur_coord';


ALTER FUNCTION public.cube_ur_coord(cube, integer) OWNER TO postgres;

--
-- TOC entry 1290 (class 1255 OID 85318)
-- Dependencies: 4822 11
-- Name: datosbasicos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION datosbasicos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO datosbasicos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO datosbasicos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO datosbasicos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO datosbasicos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.datosbasicos_audit_fun() OWNER TO postgres;

--
-- TOC entry 8907 (class 0 OID 0)
-- Dependencies: 1290
-- Name: FUNCTION datosbasicos_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION datosbasicos_audit_fun() IS 'COMMENT ON TRIGGER datosbasicos_audit_fun ON datosbasicos IS ''Tabla para administrar las tablas basicas del aplicativo.'';
';


--
-- TOC entry 1291 (class 1255 OID 85319)
-- Dependencies: 11
-- Name: dblink(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink(text) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_record';


ALTER FUNCTION public.dblink(text) OWNER TO postgres;

--
-- TOC entry 1292 (class 1255 OID 85320)
-- Dependencies: 11
-- Name: dblink(text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink(text, boolean) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_record';


ALTER FUNCTION public.dblink(text, boolean) OWNER TO postgres;

--
-- TOC entry 1293 (class 1255 OID 85321)
-- Dependencies: 11
-- Name: dblink(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink(text, text) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_record';


ALTER FUNCTION public.dblink(text, text) OWNER TO postgres;

--
-- TOC entry 1294 (class 1255 OID 85322)
-- Dependencies: 11
-- Name: dblink(text, text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink(text, text, boolean) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_record';


ALTER FUNCTION public.dblink(text, text, boolean) OWNER TO postgres;

--
-- TOC entry 1295 (class 1255 OID 85323)
-- Dependencies: 11
-- Name: dblink_build_sql_delete(text, int2vector, integer, text[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_build_sql_delete(text, int2vector, integer, text[]) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_build_sql_delete';


ALTER FUNCTION public.dblink_build_sql_delete(text, int2vector, integer, text[]) OWNER TO postgres;

--
-- TOC entry 1296 (class 1255 OID 85324)
-- Dependencies: 11
-- Name: dblink_build_sql_insert(text, int2vector, integer, text[], text[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_build_sql_insert(text, int2vector, integer, text[], text[]) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_build_sql_insert';


ALTER FUNCTION public.dblink_build_sql_insert(text, int2vector, integer, text[], text[]) OWNER TO postgres;

--
-- TOC entry 1297 (class 1255 OID 85325)
-- Dependencies: 11
-- Name: dblink_build_sql_update(text, int2vector, integer, text[], text[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_build_sql_update(text, int2vector, integer, text[], text[]) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_build_sql_update';


ALTER FUNCTION public.dblink_build_sql_update(text, int2vector, integer, text[], text[]) OWNER TO postgres;

--
-- TOC entry 1298 (class 1255 OID 85326)
-- Dependencies: 11
-- Name: dblink_cancel_query(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_cancel_query(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_cancel_query';


ALTER FUNCTION public.dblink_cancel_query(text) OWNER TO postgres;

--
-- TOC entry 1299 (class 1255 OID 85327)
-- Dependencies: 11
-- Name: dblink_close(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_close(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_close';


ALTER FUNCTION public.dblink_close(text) OWNER TO postgres;

--
-- TOC entry 1305 (class 1255 OID 85328)
-- Dependencies: 11
-- Name: dblink_close(text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_close(text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_close';


ALTER FUNCTION public.dblink_close(text, boolean) OWNER TO postgres;

--
-- TOC entry 1306 (class 1255 OID 85329)
-- Dependencies: 11
-- Name: dblink_close(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_close(text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_close';


ALTER FUNCTION public.dblink_close(text, text) OWNER TO postgres;

--
-- TOC entry 1307 (class 1255 OID 85330)
-- Dependencies: 11
-- Name: dblink_close(text, text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_close(text, text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_close';


ALTER FUNCTION public.dblink_close(text, text, boolean) OWNER TO postgres;

--
-- TOC entry 1308 (class 1255 OID 85331)
-- Dependencies: 11
-- Name: dblink_connect(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_connect(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_connect';


ALTER FUNCTION public.dblink_connect(text) OWNER TO postgres;

--
-- TOC entry 1309 (class 1255 OID 85332)
-- Dependencies: 11
-- Name: dblink_connect(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_connect(text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_connect';


ALTER FUNCTION public.dblink_connect(text, text) OWNER TO postgres;

--
-- TOC entry 1310 (class 1255 OID 85333)
-- Dependencies: 11
-- Name: dblink_connect_u(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_connect_u(text) RETURNS text
    LANGUAGE c STRICT SECURITY DEFINER
    AS '$libdir/dblink', 'dblink_connect';


ALTER FUNCTION public.dblink_connect_u(text) OWNER TO postgres;

--
-- TOC entry 1311 (class 1255 OID 85334)
-- Dependencies: 11
-- Name: dblink_connect_u(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_connect_u(text, text) RETURNS text
    LANGUAGE c STRICT SECURITY DEFINER
    AS '$libdir/dblink', 'dblink_connect';


ALTER FUNCTION public.dblink_connect_u(text, text) OWNER TO postgres;

--
-- TOC entry 1312 (class 1255 OID 85335)
-- Dependencies: 11
-- Name: dblink_current_query(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_current_query() RETURNS text
    LANGUAGE c
    AS '$libdir/dblink', 'dblink_current_query';


ALTER FUNCTION public.dblink_current_query() OWNER TO postgres;

--
-- TOC entry 1313 (class 1255 OID 85336)
-- Dependencies: 11
-- Name: dblink_disconnect(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_disconnect() RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_disconnect';


ALTER FUNCTION public.dblink_disconnect() OWNER TO postgres;

--
-- TOC entry 1314 (class 1255 OID 85337)
-- Dependencies: 11
-- Name: dblink_disconnect(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_disconnect(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_disconnect';


ALTER FUNCTION public.dblink_disconnect(text) OWNER TO postgres;

--
-- TOC entry 1315 (class 1255 OID 85338)
-- Dependencies: 11
-- Name: dblink_error_message(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_error_message(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_error_message';


ALTER FUNCTION public.dblink_error_message(text) OWNER TO postgres;

--
-- TOC entry 1316 (class 1255 OID 85339)
-- Dependencies: 11
-- Name: dblink_exec(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_exec(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_exec';


ALTER FUNCTION public.dblink_exec(text) OWNER TO postgres;

--
-- TOC entry 1317 (class 1255 OID 85340)
-- Dependencies: 11
-- Name: dblink_exec(text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_exec(text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_exec';


ALTER FUNCTION public.dblink_exec(text, boolean) OWNER TO postgres;

--
-- TOC entry 1318 (class 1255 OID 85341)
-- Dependencies: 11
-- Name: dblink_exec(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_exec(text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_exec';


ALTER FUNCTION public.dblink_exec(text, text) OWNER TO postgres;

--
-- TOC entry 1319 (class 1255 OID 85342)
-- Dependencies: 11
-- Name: dblink_exec(text, text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_exec(text, text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_exec';


ALTER FUNCTION public.dblink_exec(text, text, boolean) OWNER TO postgres;

--
-- TOC entry 1320 (class 1255 OID 85343)
-- Dependencies: 11
-- Name: dblink_fetch(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_fetch(text, integer) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_fetch';


ALTER FUNCTION public.dblink_fetch(text, integer) OWNER TO postgres;

--
-- TOC entry 1321 (class 1255 OID 85344)
-- Dependencies: 11
-- Name: dblink_fetch(text, integer, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_fetch(text, integer, boolean) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_fetch';


ALTER FUNCTION public.dblink_fetch(text, integer, boolean) OWNER TO postgres;

--
-- TOC entry 1322 (class 1255 OID 85345)
-- Dependencies: 11
-- Name: dblink_fetch(text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_fetch(text, text, integer) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_fetch';


ALTER FUNCTION public.dblink_fetch(text, text, integer) OWNER TO postgres;

--
-- TOC entry 1323 (class 1255 OID 85346)
-- Dependencies: 11
-- Name: dblink_fetch(text, text, integer, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_fetch(text, text, integer, boolean) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_fetch';


ALTER FUNCTION public.dblink_fetch(text, text, integer, boolean) OWNER TO postgres;

--
-- TOC entry 1337 (class 1255 OID 85347)
-- Dependencies: 11
-- Name: dblink_get_connections(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_get_connections() RETURNS text[]
    LANGUAGE c
    AS '$libdir/dblink', 'dblink_get_connections';


ALTER FUNCTION public.dblink_get_connections() OWNER TO postgres;

--
-- TOC entry 1338 (class 1255 OID 85348)
-- Dependencies: 2820 11
-- Name: dblink_get_pkey(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_get_pkey(text) RETURNS SETOF dblink_pkey_results
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_get_pkey';


ALTER FUNCTION public.dblink_get_pkey(text) OWNER TO postgres;

--
-- TOC entry 1383 (class 1255 OID 85349)
-- Dependencies: 11
-- Name: dblink_get_result(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_get_result(text) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_get_result';


ALTER FUNCTION public.dblink_get_result(text) OWNER TO postgres;

--
-- TOC entry 1384 (class 1255 OID 85350)
-- Dependencies: 11
-- Name: dblink_get_result(text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_get_result(text, boolean) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_get_result';


ALTER FUNCTION public.dblink_get_result(text, boolean) OWNER TO postgres;

--
-- TOC entry 1385 (class 1255 OID 85351)
-- Dependencies: 11
-- Name: dblink_is_busy(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_is_busy(text) RETURNS integer
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_is_busy';


ALTER FUNCTION public.dblink_is_busy(text) OWNER TO postgres;

--
-- TOC entry 1386 (class 1255 OID 85352)
-- Dependencies: 11
-- Name: dblink_open(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_open(text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_open';


ALTER FUNCTION public.dblink_open(text, text) OWNER TO postgres;

--
-- TOC entry 1387 (class 1255 OID 85353)
-- Dependencies: 11
-- Name: dblink_open(text, text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_open(text, text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_open';


ALTER FUNCTION public.dblink_open(text, text, boolean) OWNER TO postgres;

--
-- TOC entry 1388 (class 1255 OID 85354)
-- Dependencies: 11
-- Name: dblink_open(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_open(text, text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_open';


ALTER FUNCTION public.dblink_open(text, text, text) OWNER TO postgres;

--
-- TOC entry 1389 (class 1255 OID 85355)
-- Dependencies: 11
-- Name: dblink_open(text, text, text, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_open(text, text, text, boolean) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_open';


ALTER FUNCTION public.dblink_open(text, text, text, boolean) OWNER TO postgres;

--
-- TOC entry 1390 (class 1255 OID 85356)
-- Dependencies: 11
-- Name: dblink_send_query(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dblink_send_query(text, text) RETURNS integer
    LANGUAGE c STRICT
    AS '$libdir/dblink', 'dblink_send_query';


ALTER FUNCTION public.dblink_send_query(text, text) OWNER TO postgres;

--
-- TOC entry 1391 (class 1255 OID 85357)
-- Dependencies: 11
-- Name: dearmor(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dearmor(text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_dearmor';


ALTER FUNCTION public.dearmor(text) OWNER TO postgres;

--
-- TOC entry 1424 (class 1255 OID 85358)
-- Dependencies: 4822 11
-- Name: decisionterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION decisionterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO decisionterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO decisionterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO decisionterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO decisionterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.decisionterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1425 (class 1255 OID 85359)
-- Dependencies: 11
-- Name: decrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_decrypt';


ALTER FUNCTION public.decrypt(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1426 (class 1255 OID 85360)
-- Dependencies: 11
-- Name: decrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_decrypt_iv';


ALTER FUNCTION public.decrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1427 (class 1255 OID 85361)
-- Dependencies: 2859 11
-- Name: defined(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION defined(hstore, text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'defined';


ALTER FUNCTION public.defined(hstore, text) OWNER TO postgres;

--
-- TOC entry 1428 (class 1255 OID 85362)
-- Dependencies: 2859 2859 11
-- Name: delete(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION delete(hstore, text) RETURNS hstore
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'delete';


ALTER FUNCTION public.delete(hstore, text) OWNER TO postgres;

--
-- TOC entry 1429 (class 1255 OID 85363)
-- Dependencies: 4822 11
-- Name: delete_hecho_formulacion(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION delete_hecho_formulacion(integer) RETURNS integer
    LANGUAGE plpgsql
    AS $_$
	DECLARE 
		val integer;
		BEGIN
		delete from public.relacionautorhecho where idhecho = $1;
		delete from public.relacionvictimahecho where idhecho = $1;
		delete from public.hecho where idhecho = $1;
				
		select count(*) INTO val FROM public.hecho where idhecho = $1;
		RETURN val;	
	END;
	$_$;


ALTER FUNCTION public.delete_hecho_formulacion(integer) OWNER TO postgres;

--
-- TOC entry 1430 (class 1255 OID 85364)
-- Dependencies: 4822 11
-- Name: delito_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION delito_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO delito_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO delito_audit SELECT 'U', now(), NEW.*;
            INSERT INTO delito_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO delito_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.delito_audit_fun() OWNER TO postgres;

--
-- TOC entry 8908 (class 0 OID 0)
-- Dependencies: 1430
-- Name: FUNCTION delito_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION delito_audit_fun() IS 'delito';


--
-- TOC entry 1431 (class 1255 OID 85365)
-- Dependencies: 4822 11
-- Name: denunciaadicional_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION denunciaadicional_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO denunciaadicional_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO denunciaadicional_audit SELECT 'U', now(), NEW.*;
            INSERT INTO denunciaadicional_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO denunciaadicional_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.denunciaadicional_audit_fun() OWNER TO postgres;

--
-- TOC entry 8909 (class 0 OID 0)
-- Dependencies: 1431
-- Name: FUNCTION denunciaadicional_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION denunciaadicional_audit_fun() IS 'COMMENT ON TRIGGER denunciaadicional_trigger_fun ON denunciaadicional IS ''Tabla denuncia adicional'';
';


--
-- TOC entry 1432 (class 1255 OID 85366)
-- Dependencies: 4822 11
-- Name: desmovilizacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION desmovilizacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO desmovilizacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO desmovilizacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO desmovilizacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO desmovilizacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.desmovilizacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8910 (class 0 OID 0)
-- Dependencies: 1432
-- Name: FUNCTION desmovilizacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION desmovilizacion_audit_fun() IS 'Tabla desmovilizacion';


--
-- TOC entry 1433 (class 1255 OID 85367)
-- Dependencies: 4822 11
-- Name: desmovilizado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION desmovilizado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO desmovilizado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO desmovilizado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO desmovilizado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO desmovilizado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.desmovilizado_audit_fun() OWNER TO postgres;

--
-- TOC entry 8911 (class 0 OID 0)
-- Dependencies: 1433
-- Name: FUNCTION desmovilizado_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION desmovilizado_audit_fun() IS 'Identificacion del desmovilizado';


--
-- TOC entry 1434 (class 1255 OID 85368)
-- Dependencies: 4822 11
-- Name: despacho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION despacho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO despacho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO despacho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO despacho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO despacho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.despacho_audit_fun() OWNER TO postgres;

--
-- TOC entry 1435 (class 1255 OID 85369)
-- Dependencies: 11
-- Name: difference(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION difference(text, text) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'difference';


ALTER FUNCTION public.difference(text, text) OWNER TO postgres;

--
-- TOC entry 1436 (class 1255 OID 85370)
-- Dependencies: 11
-- Name: digest(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION digest(bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_digest';


ALTER FUNCTION public.digest(bytea, text) OWNER TO postgres;

--
-- TOC entry 1437 (class 1255 OID 85371)
-- Dependencies: 11
-- Name: digest(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION digest(text, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_digest';


ALTER FUNCTION public.digest(text, text) OWNER TO postgres;

--
-- TOC entry 1438 (class 1255 OID 85372)
-- Dependencies: 11
-- Name: dmetaphone(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dmetaphone(text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'dmetaphone';


ALTER FUNCTION public.dmetaphone(text) OWNER TO postgres;

--
-- TOC entry 1439 (class 1255 OID 85373)
-- Dependencies: 11
-- Name: dmetaphone_alt(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION dmetaphone_alt(text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'dmetaphone_alt';


ALTER FUNCTION public.dmetaphone_alt(text) OWNER TO postgres;

--
-- TOC entry 1444 (class 1255 OID 85374)
-- Dependencies: 4822 11
-- Name: documento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO documento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documento_audit_fun() OWNER TO postgres;

--
-- TOC entry 8912 (class 0 OID 0)
-- Dependencies: 1444
-- Name: FUNCTION documento_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION documento_audit_fun() IS 'Documentos.';


--
-- TOC entry 1445 (class 1255 OID 85375)
-- Dependencies: 4822 11
-- Name: documentocarpeta_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentocarpeta_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentocarpeta_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentocarpeta_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentocarpeta_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentocarpeta_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentocarpeta_audit_fun() OWNER TO postgres;

--
-- TOC entry 1446 (class 1255 OID 85376)
-- Dependencies: 4822 11
-- Name: documentocompulsacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentocompulsacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentocompulsacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentocompulsacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentocompulsacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentocompulsacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentocompulsacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1447 (class 1255 OID 85377)
-- Dependencies: 4822 11
-- Name: documentoedictoemplazatorio_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentoedictoemplazatorio_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentoedictoemplazatorio_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentoedictoemplazatorio_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentoedictoemplazatorio_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentoedictoemplazatorio_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentoedictoemplazatorio_audit_fun() OWNER TO postgres;

--
-- TOC entry 1448 (class 1255 OID 85378)
-- Dependencies: 4822 11
-- Name: documentopersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentopersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentopersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentopersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentopersona_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentopersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentopersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 8913 (class 0 OID 0)
-- Dependencies: 1448
-- Name: FUNCTION documentopersona_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION documentopersona_audit_fun() IS 'Lista de documentos que tiene una persona.';


--
-- TOC entry 1449 (class 1255 OID 85379)
-- Dependencies: 4822 11
-- Name: documentopostulacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentopostulacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentopostulacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentopostulacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentopostulacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentopostulacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentopostulacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1450 (class 1255 OID 85380)
-- Dependencies: 4822 11
-- Name: documentospostulacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION documentospostulacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO documentospostulacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO documentospostulacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO documentospostulacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO documentospostulacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.documentospostulacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1451 (class 1255 OID 85381)
-- Dependencies: 2859 11
-- Name: each(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION each(hs hstore, OUT key text, OUT value text) RETURNS SETOF record
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'each';


ALTER FUNCTION public.each(hs hstore, OUT key text, OUT value text) OWNER TO postgres;

--
-- TOC entry 1452 (class 1255 OID 85382)
-- Dependencies: 2827 2816 11
-- Name: earth_box(earth, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION earth_box(earth, double precision) RETURNS cube
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT cube_enlarge($1, gc_to_sec($2), 3)$_$;


ALTER FUNCTION public.earth_box(earth, double precision) OWNER TO postgres;

--
-- TOC entry 1453 (class 1255 OID 85383)
-- Dependencies: 2827 2827 11
-- Name: earth_distance(earth, earth); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION earth_distance(earth, earth) RETURNS double precision
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT sec_to_gc(cube_distance($1, $2))$_$;


ALTER FUNCTION public.earth_distance(earth, earth) OWNER TO postgres;

--
-- TOC entry 1454 (class 1255 OID 85384)
-- Dependencies: 11
-- Name: encrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_encrypt';


ALTER FUNCTION public.encrypt(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1455 (class 1255 OID 85385)
-- Dependencies: 11
-- Name: encrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_encrypt_iv';


ALTER FUNCTION public.encrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1456 (class 1255 OID 85386)
-- Dependencies: 2810 11
-- Name: eq(chkpass, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION eq(chkpass, text) RETURNS boolean
    LANGUAGE c STRICT
    AS '$libdir/chkpass', 'chkpass_eq';


ALTER FUNCTION public.eq(chkpass, text) OWNER TO postgres;

--
-- TOC entry 1461 (class 1255 OID 85387)
-- Dependencies: 4822 11
-- Name: estadoetapaproceso_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION estadoetapaproceso_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO estadoetapaproceso_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO estadoetapaproceso_audit SELECT 'U', now(), NEW.*;
            INSERT INTO estadoetapaproceso_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO estadoetapaproceso_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.estadoetapaproceso_audit_fun() OWNER TO postgres;

--
-- TOC entry 8914 (class 0 OID 0)
-- Dependencies: 1461
-- Name: FUNCTION estadoetapaproceso_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION estadoetapaproceso_audit_fun() IS 'Estados en los que se puede encontrar un proceso de Justicia y Paz.';


--
-- TOC entry 1462 (class 1255 OID 85388)
-- Dependencies: 4822 11
-- Name: estadohistoricoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION estadohistoricoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO estadohistoricoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO estadohistoricoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO estadohistoricoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO estadohistoricoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.estadohistoricoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 1463 (class 1255 OID 85389)
-- Dependencies: 4822 11
-- Name: estadopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION estadopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO estadopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO estadopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO estadopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO estadopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.estadopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1464 (class 1255 OID 85390)
-- Dependencies: 4822 11
-- Name: estadoprogramacionreporte_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION estadoprogramacionreporte_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO estadoprogramacionreporte_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO estadoprogramacionreporte_audit SELECT 'U', now(), NEW.*;
            INSERT INTO estadoprogramacionreporte_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO estadoprogramacionreporte_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.estadoprogramacionreporte_audit_fun() OWNER TO postgres;

--
-- TOC entry 1465 (class 1255 OID 85391)
-- Dependencies: 4822 11
-- Name: etapaflujoinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION etapaflujoinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO etapaflujoinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO etapaflujoinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO etapaflujoinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO etapaflujoinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.etapaflujoinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8915 (class 0 OID 0)
-- Dependencies: 1465
-- Name: FUNCTION etapaflujoinformacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION etapaflujoinformacion_audit_fun() IS 'Etapas del flujo de informacion de una fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 1466 (class 1255 OID 85392)
-- Dependencies: 4822 11
-- Name: etapahistoricoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION etapahistoricoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO etapahistoricoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO etapahistoricoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO etapahistoricoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO etapahistoricoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.etapahistoricoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 1467 (class 1255 OID 85393)
-- Dependencies: 4822 11
-- Name: etapaproceso_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION etapaproceso_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO etapaproceso_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO etapaproceso_audit SELECT 'U', now(), NEW.*;
            INSERT INTO etapaproceso_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO etapaproceso_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.etapaproceso_audit_fun() OWNER TO postgres;

--
-- TOC entry 8916 (class 0 OID 0)
-- Dependencies: 1467
-- Name: FUNCTION etapaproceso_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION etapaproceso_audit_fun() IS 'Etapas del proceso de Justicia y Paz';


--
-- TOC entry 1468 (class 1255 OID 85394)
-- Dependencies: 4822 11
-- Name: evento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION evento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO evento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO evento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO evento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO evento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.evento_audit_fun() OWNER TO postgres;

--
-- TOC entry 8917 (class 0 OID 0)
-- Dependencies: 1468
-- Name: FUNCTION evento_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION evento_audit_fun() IS 'Tabla caracteristicas evento';


--
-- TOC entry 1469 (class 1255 OID 85395)
-- Dependencies: 2859 11
-- Name: exist(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION exist(hstore, text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'exists';


ALTER FUNCTION public.exist(hstore, text) OWNER TO postgres;

--
-- TOC entry 1470 (class 1255 OID 85396)
-- Dependencies: 4822 11
-- Name: factoringresoga_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION factoringresoga_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO factoringresoga_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO factoringresoga_audit SELECT 'U', now(), NEW.*;
            INSERT INTO factoringresoga_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO factoringresoga_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.factoringresoga_audit_fun() OWNER TO postgres;

--
-- TOC entry 1457 (class 1255 OID 85397)
-- Dependencies: 11
-- Name: fecha_concatenada(character varying, date, date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fecha_concatenada(character varying, date, date) RETURNS character varying
    LANGUAGE sql IMMUTABLE
    AS $_$
-- AUTOR: JIMMY ALEXANDER CRUZ QUINTERO
-- FUNCION QUE RETORNA EL TIPO DE FECHA, LA FECHA INICIAL Y LA FINAL SEPARADAS POR -
-- DATE: 13 DE JULIO DE 2010
	SELECT
		$1 || 
		CASE
			WHEN NOT $2 IS NULL THEN '-' || $2 ||
				CASE
					WHEN NOT $3 IS NULL THEN '-' || $3
					ELSE ''
				END
			ELSE ''
		END AS fecha
$_$;


ALTER FUNCTION public.fecha_concatenada(character varying, date, date) OWNER TO postgres;

--
-- TOC entry 8918 (class 0 OID 0)
-- Dependencies: 1457
-- Name: FUNCTION fecha_concatenada(character varying, date, date); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION fecha_concatenada(character varying, date, date) IS 'FUNCION QUE RETORNA EL TIPO DE FECHA, LA FECHA INICIAL Y LA FINAL SEPARADAS POR ''-''';


--
-- TOC entry 1475 (class 1255 OID 85398)
-- Dependencies: 4822 11
-- Name: fechaasignacionpostulado(integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fechaasignacionpostulado(integer, text) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$

DECLARE
seejecuto boolean;
BEGIN
seejecuto:= False;
--Actualizacion postulado
UPDATE 
  public.postulado
SET
  fechaasignacion = NOW(),
  usuario = $2
WHERE
  public.postulado.radicado IN (SELECT
  public.postulado.radicado
FROM
  public.relacionpostuladoacta
  INNER JOIN public.postulado ON (public.relacionpostuladoacta.radicado = public.postulado.radicado)
  INNER JOIN public.acta_asignacion ON (public.relacionpostuladoacta.idacta = public.acta_asignacion.idacta)
  AND (public.postulado.despacho = public.acta_asignacion.despacho)
WHERE
  public.relacionpostuladoacta.idacta = $1 AND
  postulado.fechaasignacion IS NULL);
--asignacion
UPDATE 
  public.acta_asignacion
SET
  firma = TRUE,
  usuario = $2,
  fecha = NOW()
  where
   idacta = $1;

seejecuto:= True;
   
RETURN seejecuto;

END
$_$;


ALTER FUNCTION public.fechaasignacionpostulado(integer, text) OWNER TO postgres;

--
-- TOC entry 1476 (class 1255 OID 85399)
-- Dependencies: 2859 11
-- Name: fetchval(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fetchval(hstore, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'fetchval';


ALTER FUNCTION public.fetchval(hstore, text) OWNER TO postgres;

--
-- TOC entry 1477 (class 1255 OID 85400)
-- Dependencies: 4822 11
-- Name: fotos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fotos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO fotos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO fotos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO fotos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO fotos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.fotos_audit_fun() OWNER TO postgres;

--
-- TOC entry 1478 (class 1255 OID 85401)
-- Dependencies: 4822 11
-- Name: fuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO fuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO fuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO fuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO fuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.fuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8919 (class 0 OID 0)
-- Dependencies: 1478
-- Name: FUNCTION fuenteinformacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION fuenteinformacion_audit_fun() IS 'Fuente de informacion';


--
-- TOC entry 1479 (class 1255 OID 85402)
-- Dependencies: 4822 11
-- Name: fuenteinformaciondatos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION fuenteinformaciondatos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO fuenteinformaciondatos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO fuenteinformaciondatos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO fuenteinformaciondatos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO fuenteinformaciondatos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.fuenteinformaciondatos_audit_fun() OWNER TO postgres;

--
-- TOC entry 8920 (class 0 OID 0)
-- Dependencies: 1479
-- Name: FUNCTION fuenteinformaciondatos_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION fuenteinformaciondatos_audit_fun() IS 'Fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 1480 (class 1255 OID 85403)
-- Dependencies: 4822 11
-- Name: funcion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION funcion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO funcion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO funcion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO funcion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO funcion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.funcion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8921 (class 0 OID 0)
-- Dependencies: 1480
-- Name: FUNCTION funcion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION funcion_audit_fun() IS 'funcion';


--
-- TOC entry 1481 (class 1255 OID 85404)
-- Dependencies: 4822 11
-- Name: funcionasignaciongrupoarmadohistorico(integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION funcionasignaciongrupoarmadohistorico(integer, text) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
-- datos de entrada  idasignaciongrupoarmado, usuario

DECLARE
seejecuto boolean;
cons  record;
BEGIN
seejecuto:= false;

--Genero la consulta

FOR cons IN

SELECT 
  resolucionasignacion.idresolucionasignacion,
  asignaciongrupoarmado.numerogrupoarmado,
  asignaciongrupoarmado.fiscal,
  asignaciongrupoarmado.despacho
FROM
  resolucionasignacion
  INNER JOIN asignaciongrupoarmado ON (resolucionasignacion.idresolucionasignacion = asignaciongrupoarmado.idresolucionasignacion)
WHERE
  idasignaciongrupoarmado = $1


--Ingreso los datos
LOOP
if(cons.fiscal is not null) then

-- INSERTO LOS DATOS EN asignaciongrupoarmadohistorico

   INSERT INTO
  public.asignaciongrupoarmadohistorico(idasignaciongrupoarmado, idresolucionasignacion, fechaactualizacion, numerogrupoarmado, 
					fiscal, despacho, usuario)
 VALUES($1, cons.idresolucionasignacion,NOW(),cons.numerogrupoarmado,cons.fiscal,cons.despacho,$2);
 
seejecuto:= true;      
end if;

END LOOP;
   
RETURN seejecuto;

END
$_$;


ALTER FUNCTION public.funcionasignaciongrupoarmadohistorico(integer, text) OWNER TO postgres;

--
-- TOC entry 1482 (class 1255 OID 85405)
-- Dependencies: 4822 11
-- Name: funcionasignaciongrupoarmadohistorico_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION funcionasignaciongrupoarmadohistorico_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'UPDATE' OR TG_OP = 'INSERT') THEN
		PERFORM funcionasignaciongrupoarmadohistorico(NEW.idasignaciongrupoarmado,NEW.usuario);           
            RETURN NEW;       
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.funcionasignaciongrupoarmadohistorico_fun() OWNER TO postgres;

--
-- TOC entry 1483 (class 1255 OID 85406)
-- Dependencies: 11
-- Name: g_cube_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_compress';


ALTER FUNCTION public.g_cube_compress(internal) OWNER TO postgres;

--
-- TOC entry 1484 (class 1255 OID 85407)
-- Dependencies: 2816 11
-- Name: g_cube_consistent(internal, cube, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_consistent(internal, cube, integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_consistent';


ALTER FUNCTION public.g_cube_consistent(internal, cube, integer) OWNER TO postgres;

--
-- TOC entry 1485 (class 1255 OID 85408)
-- Dependencies: 11
-- Name: g_cube_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_decompress';


ALTER FUNCTION public.g_cube_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1486 (class 1255 OID 85409)
-- Dependencies: 11
-- Name: g_cube_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/cube', 'g_cube_penalty';


ALTER FUNCTION public.g_cube_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1487 (class 1255 OID 85410)
-- Dependencies: 11
-- Name: g_cube_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_picksplit';


ALTER FUNCTION public.g_cube_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1488 (class 1255 OID 85411)
-- Dependencies: 2816 2816 11
-- Name: g_cube_same(cube, cube, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_same(cube, cube, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_same';


ALTER FUNCTION public.g_cube_same(cube, cube, internal) OWNER TO postgres;

--
-- TOC entry 1489 (class 1255 OID 85412)
-- Dependencies: 2816 11
-- Name: g_cube_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_cube_union(internal, internal) RETURNS cube
    LANGUAGE c IMMUTABLE
    AS '$libdir/cube', 'g_cube_union';


ALTER FUNCTION public.g_cube_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1490 (class 1255 OID 85413)
-- Dependencies: 11
-- Name: g_int_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_compress';


ALTER FUNCTION public.g_int_compress(internal) OWNER TO postgres;

--
-- TOC entry 1491 (class 1255 OID 85414)
-- Dependencies: 11
-- Name: g_int_consistent(internal, integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_consistent(internal, integer[], integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_consistent';


ALTER FUNCTION public.g_int_consistent(internal, integer[], integer) OWNER TO postgres;

--
-- TOC entry 1471 (class 1255 OID 85415)
-- Dependencies: 11
-- Name: g_int_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_decompress';


ALTER FUNCTION public.g_int_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1472 (class 1255 OID 85416)
-- Dependencies: 11
-- Name: g_int_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'g_int_penalty';


ALTER FUNCTION public.g_int_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1473 (class 1255 OID 85417)
-- Dependencies: 11
-- Name: g_int_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_picksplit';


ALTER FUNCTION public.g_int_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1392 (class 1255 OID 85418)
-- Dependencies: 11
-- Name: g_int_same(integer[], integer[], internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_same(integer[], integer[], internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_same';


ALTER FUNCTION public.g_int_same(integer[], integer[], internal) OWNER TO postgres;

--
-- TOC entry 1440 (class 1255 OID 85419)
-- Dependencies: 11
-- Name: g_int_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_int_union(internal, internal) RETURNS integer[]
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_int_union';


ALTER FUNCTION public.g_int_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1441 (class 1255 OID 85420)
-- Dependencies: 11
-- Name: g_intbig_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_compress';


ALTER FUNCTION public.g_intbig_compress(internal) OWNER TO postgres;

--
-- TOC entry 1442 (class 1255 OID 85421)
-- Dependencies: 11
-- Name: g_intbig_consistent(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_consistent(internal, internal, integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_consistent';


ALTER FUNCTION public.g_intbig_consistent(internal, internal, integer) OWNER TO postgres;

--
-- TOC entry 1443 (class 1255 OID 85422)
-- Dependencies: 11
-- Name: g_intbig_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_decompress';


ALTER FUNCTION public.g_intbig_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1458 (class 1255 OID 85423)
-- Dependencies: 11
-- Name: g_intbig_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'g_intbig_penalty';


ALTER FUNCTION public.g_intbig_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1459 (class 1255 OID 85424)
-- Dependencies: 11
-- Name: g_intbig_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_picksplit';


ALTER FUNCTION public.g_intbig_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1460 (class 1255 OID 85425)
-- Dependencies: 11
-- Name: g_intbig_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_same';


ALTER FUNCTION public.g_intbig_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1493 (class 1255 OID 85426)
-- Dependencies: 11
-- Name: g_intbig_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION g_intbig_union(internal, internal) RETURNS integer[]
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'g_intbig_union';


ALTER FUNCTION public.g_intbig_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1494 (class 1255 OID 85427)
-- Dependencies: 11
-- Name: gbt_bit_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bit_compress';


ALTER FUNCTION public.gbt_bit_compress(internal) OWNER TO postgres;

--
-- TOC entry 1495 (class 1255 OID 85428)
-- Dependencies: 11
-- Name: gbt_bit_consistent(internal, bit, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_consistent(internal, bit, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bit_consistent';


ALTER FUNCTION public.gbt_bit_consistent(internal, bit, smallint) OWNER TO postgres;

--
-- TOC entry 1496 (class 1255 OID 85429)
-- Dependencies: 11
-- Name: gbt_bit_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_bit_penalty';


ALTER FUNCTION public.gbt_bit_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1497 (class 1255 OID 85430)
-- Dependencies: 11
-- Name: gbt_bit_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bit_picksplit';


ALTER FUNCTION public.gbt_bit_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1498 (class 1255 OID 85431)
-- Dependencies: 11
-- Name: gbt_bit_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bit_same';


ALTER FUNCTION public.gbt_bit_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1499 (class 1255 OID 85432)
-- Dependencies: 2849 11
-- Name: gbt_bit_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bit_union(bytea, internal) RETURNS gbtreekey_var
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bit_union';


ALTER FUNCTION public.gbt_bit_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1500 (class 1255 OID 85433)
-- Dependencies: 11
-- Name: gbt_bpchar_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bpchar_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bpchar_compress';


ALTER FUNCTION public.gbt_bpchar_compress(internal) OWNER TO postgres;

--
-- TOC entry 1501 (class 1255 OID 85434)
-- Dependencies: 11
-- Name: gbt_bpchar_consistent(internal, character, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bpchar_consistent(internal, character, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bpchar_consistent';


ALTER FUNCTION public.gbt_bpchar_consistent(internal, character, smallint) OWNER TO postgres;

--
-- TOC entry 1502 (class 1255 OID 85435)
-- Dependencies: 11
-- Name: gbt_bytea_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bytea_compress';


ALTER FUNCTION public.gbt_bytea_compress(internal) OWNER TO postgres;

--
-- TOC entry 1503 (class 1255 OID 85436)
-- Dependencies: 11
-- Name: gbt_bytea_consistent(internal, bytea, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_consistent(internal, bytea, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bytea_consistent';


ALTER FUNCTION public.gbt_bytea_consistent(internal, bytea, smallint) OWNER TO postgres;

--
-- TOC entry 1504 (class 1255 OID 85437)
-- Dependencies: 11
-- Name: gbt_bytea_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_bytea_penalty';


ALTER FUNCTION public.gbt_bytea_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1505 (class 1255 OID 85438)
-- Dependencies: 11
-- Name: gbt_bytea_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bytea_picksplit';


ALTER FUNCTION public.gbt_bytea_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1506 (class 1255 OID 85439)
-- Dependencies: 11
-- Name: gbt_bytea_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bytea_same';


ALTER FUNCTION public.gbt_bytea_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1507 (class 1255 OID 85440)
-- Dependencies: 2849 11
-- Name: gbt_bytea_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_bytea_union(bytea, internal) RETURNS gbtreekey_var
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_bytea_union';


ALTER FUNCTION public.gbt_bytea_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1508 (class 1255 OID 85441)
-- Dependencies: 11
-- Name: gbt_cash_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_cash_compress';


ALTER FUNCTION public.gbt_cash_compress(internal) OWNER TO postgres;

--
-- TOC entry 1509 (class 1255 OID 85442)
-- Dependencies: 11
-- Name: gbt_cash_consistent(internal, money, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_consistent(internal, money, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_cash_consistent';


ALTER FUNCTION public.gbt_cash_consistent(internal, money, smallint) OWNER TO postgres;

--
-- TOC entry 1510 (class 1255 OID 85443)
-- Dependencies: 11
-- Name: gbt_cash_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_cash_penalty';


ALTER FUNCTION public.gbt_cash_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1511 (class 1255 OID 85444)
-- Dependencies: 11
-- Name: gbt_cash_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_cash_picksplit';


ALTER FUNCTION public.gbt_cash_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1512 (class 1255 OID 85445)
-- Dependencies: 11
-- Name: gbt_cash_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_cash_same';


ALTER FUNCTION public.gbt_cash_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1513 (class 1255 OID 85446)
-- Dependencies: 2843 11
-- Name: gbt_cash_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_cash_union(bytea, internal) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_cash_union';


ALTER FUNCTION public.gbt_cash_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1514 (class 1255 OID 85447)
-- Dependencies: 11
-- Name: gbt_date_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_date_compress';


ALTER FUNCTION public.gbt_date_compress(internal) OWNER TO postgres;

--
-- TOC entry 1515 (class 1255 OID 85448)
-- Dependencies: 11
-- Name: gbt_date_consistent(internal, date, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_consistent(internal, date, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_date_consistent';


ALTER FUNCTION public.gbt_date_consistent(internal, date, smallint) OWNER TO postgres;

--
-- TOC entry 1516 (class 1255 OID 85449)
-- Dependencies: 11
-- Name: gbt_date_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_date_penalty';


ALTER FUNCTION public.gbt_date_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1517 (class 1255 OID 85450)
-- Dependencies: 11
-- Name: gbt_date_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_date_picksplit';


ALTER FUNCTION public.gbt_date_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1518 (class 1255 OID 85451)
-- Dependencies: 11
-- Name: gbt_date_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_date_same';


ALTER FUNCTION public.gbt_date_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1519 (class 1255 OID 85452)
-- Dependencies: 2843 11
-- Name: gbt_date_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_date_union(bytea, internal) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_date_union';


ALTER FUNCTION public.gbt_date_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1520 (class 1255 OID 85453)
-- Dependencies: 11
-- Name: gbt_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_decompress';


ALTER FUNCTION public.gbt_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1521 (class 1255 OID 85454)
-- Dependencies: 11
-- Name: gbt_float4_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float4_compress';


ALTER FUNCTION public.gbt_float4_compress(internal) OWNER TO postgres;

--
-- TOC entry 1522 (class 1255 OID 85455)
-- Dependencies: 11
-- Name: gbt_float4_consistent(internal, real, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_consistent(internal, real, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float4_consistent';


ALTER FUNCTION public.gbt_float4_consistent(internal, real, smallint) OWNER TO postgres;

--
-- TOC entry 1523 (class 1255 OID 85456)
-- Dependencies: 11
-- Name: gbt_float4_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_float4_penalty';


ALTER FUNCTION public.gbt_float4_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1524 (class 1255 OID 85457)
-- Dependencies: 11
-- Name: gbt_float4_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float4_picksplit';


ALTER FUNCTION public.gbt_float4_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1525 (class 1255 OID 85458)
-- Dependencies: 11
-- Name: gbt_float4_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float4_same';


ALTER FUNCTION public.gbt_float4_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1526 (class 1255 OID 85459)
-- Dependencies: 2843 11
-- Name: gbt_float4_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float4_union(bytea, internal) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float4_union';


ALTER FUNCTION public.gbt_float4_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1527 (class 1255 OID 85460)
-- Dependencies: 11
-- Name: gbt_float8_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float8_compress';


ALTER FUNCTION public.gbt_float8_compress(internal) OWNER TO postgres;

--
-- TOC entry 1528 (class 1255 OID 85461)
-- Dependencies: 11
-- Name: gbt_float8_consistent(internal, double precision, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_consistent(internal, double precision, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float8_consistent';


ALTER FUNCTION public.gbt_float8_consistent(internal, double precision, smallint) OWNER TO postgres;

--
-- TOC entry 1529 (class 1255 OID 85462)
-- Dependencies: 11
-- Name: gbt_float8_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_float8_penalty';


ALTER FUNCTION public.gbt_float8_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1530 (class 1255 OID 85463)
-- Dependencies: 11
-- Name: gbt_float8_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float8_picksplit';


ALTER FUNCTION public.gbt_float8_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1531 (class 1255 OID 85464)
-- Dependencies: 11
-- Name: gbt_float8_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float8_same';


ALTER FUNCTION public.gbt_float8_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1532 (class 1255 OID 85465)
-- Dependencies: 2833 11
-- Name: gbt_float8_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_float8_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_float8_union';


ALTER FUNCTION public.gbt_float8_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1533 (class 1255 OID 85466)
-- Dependencies: 11
-- Name: gbt_inet_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_inet_compress';


ALTER FUNCTION public.gbt_inet_compress(internal) OWNER TO postgres;

--
-- TOC entry 1534 (class 1255 OID 85467)
-- Dependencies: 11
-- Name: gbt_inet_consistent(internal, inet, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_consistent(internal, inet, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_inet_consistent';


ALTER FUNCTION public.gbt_inet_consistent(internal, inet, smallint) OWNER TO postgres;

--
-- TOC entry 1535 (class 1255 OID 85468)
-- Dependencies: 11
-- Name: gbt_inet_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_inet_penalty';


ALTER FUNCTION public.gbt_inet_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1536 (class 1255 OID 85469)
-- Dependencies: 11
-- Name: gbt_inet_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_inet_picksplit';


ALTER FUNCTION public.gbt_inet_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1537 (class 1255 OID 85470)
-- Dependencies: 11
-- Name: gbt_inet_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_inet_same';


ALTER FUNCTION public.gbt_inet_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1538 (class 1255 OID 85471)
-- Dependencies: 2833 11
-- Name: gbt_inet_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_inet_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_inet_union';


ALTER FUNCTION public.gbt_inet_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1539 (class 1255 OID 85472)
-- Dependencies: 11
-- Name: gbt_int2_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int2_compress';


ALTER FUNCTION public.gbt_int2_compress(internal) OWNER TO postgres;

--
-- TOC entry 1540 (class 1255 OID 85473)
-- Dependencies: 11
-- Name: gbt_int2_consistent(internal, smallint, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_consistent(internal, smallint, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int2_consistent';


ALTER FUNCTION public.gbt_int2_consistent(internal, smallint, smallint) OWNER TO postgres;

--
-- TOC entry 1541 (class 1255 OID 85474)
-- Dependencies: 11
-- Name: gbt_int2_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_int2_penalty';


ALTER FUNCTION public.gbt_int2_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1542 (class 1255 OID 85475)
-- Dependencies: 11
-- Name: gbt_int2_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int2_picksplit';


ALTER FUNCTION public.gbt_int2_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1543 (class 1255 OID 85476)
-- Dependencies: 11
-- Name: gbt_int2_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int2_same';


ALTER FUNCTION public.gbt_int2_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1544 (class 1255 OID 85477)
-- Dependencies: 2837 11
-- Name: gbt_int2_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int2_union(bytea, internal) RETURNS gbtreekey4
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int2_union';


ALTER FUNCTION public.gbt_int2_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1545 (class 1255 OID 85478)
-- Dependencies: 11
-- Name: gbt_int4_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int4_compress';


ALTER FUNCTION public.gbt_int4_compress(internal) OWNER TO postgres;

--
-- TOC entry 1546 (class 1255 OID 85479)
-- Dependencies: 11
-- Name: gbt_int4_consistent(internal, integer, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_consistent(internal, integer, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int4_consistent';


ALTER FUNCTION public.gbt_int4_consistent(internal, integer, smallint) OWNER TO postgres;

--
-- TOC entry 1547 (class 1255 OID 85480)
-- Dependencies: 11
-- Name: gbt_int4_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_int4_penalty';


ALTER FUNCTION public.gbt_int4_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1548 (class 1255 OID 85481)
-- Dependencies: 11
-- Name: gbt_int4_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int4_picksplit';


ALTER FUNCTION public.gbt_int4_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1549 (class 1255 OID 85482)
-- Dependencies: 11
-- Name: gbt_int4_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int4_same';


ALTER FUNCTION public.gbt_int4_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1550 (class 1255 OID 85483)
-- Dependencies: 2843 11
-- Name: gbt_int4_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int4_union(bytea, internal) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int4_union';


ALTER FUNCTION public.gbt_int4_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1551 (class 1255 OID 85484)
-- Dependencies: 11
-- Name: gbt_int8_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int8_compress';


ALTER FUNCTION public.gbt_int8_compress(internal) OWNER TO postgres;

--
-- TOC entry 1552 (class 1255 OID 85485)
-- Dependencies: 11
-- Name: gbt_int8_consistent(internal, bigint, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_consistent(internal, bigint, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int8_consistent';


ALTER FUNCTION public.gbt_int8_consistent(internal, bigint, smallint) OWNER TO postgres;

--
-- TOC entry 1553 (class 1255 OID 85486)
-- Dependencies: 11
-- Name: gbt_int8_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_int8_penalty';


ALTER FUNCTION public.gbt_int8_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1554 (class 1255 OID 85487)
-- Dependencies: 11
-- Name: gbt_int8_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int8_picksplit';


ALTER FUNCTION public.gbt_int8_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1555 (class 1255 OID 85488)
-- Dependencies: 11
-- Name: gbt_int8_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int8_same';


ALTER FUNCTION public.gbt_int8_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1556 (class 1255 OID 85489)
-- Dependencies: 2833 11
-- Name: gbt_int8_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_int8_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_int8_union';


ALTER FUNCTION public.gbt_int8_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1557 (class 1255 OID 85490)
-- Dependencies: 11
-- Name: gbt_intv_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_compress';


ALTER FUNCTION public.gbt_intv_compress(internal) OWNER TO postgres;

--
-- TOC entry 1558 (class 1255 OID 85491)
-- Dependencies: 11
-- Name: gbt_intv_consistent(internal, interval, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_consistent(internal, interval, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_consistent';


ALTER FUNCTION public.gbt_intv_consistent(internal, interval, smallint) OWNER TO postgres;

--
-- TOC entry 1559 (class 1255 OID 85492)
-- Dependencies: 11
-- Name: gbt_intv_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_decompress';


ALTER FUNCTION public.gbt_intv_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1560 (class 1255 OID 85493)
-- Dependencies: 11
-- Name: gbt_intv_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_intv_penalty';


ALTER FUNCTION public.gbt_intv_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1561 (class 1255 OID 85494)
-- Dependencies: 11
-- Name: gbt_intv_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_picksplit';


ALTER FUNCTION public.gbt_intv_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1562 (class 1255 OID 85495)
-- Dependencies: 11
-- Name: gbt_intv_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_same';


ALTER FUNCTION public.gbt_intv_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1563 (class 1255 OID 85496)
-- Dependencies: 2808 11
-- Name: gbt_intv_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_intv_union(bytea, internal) RETURNS gbtreekey32
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_intv_union';


ALTER FUNCTION public.gbt_intv_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1564 (class 1255 OID 85497)
-- Dependencies: 11
-- Name: gbt_macad_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_macad_compress';


ALTER FUNCTION public.gbt_macad_compress(internal) OWNER TO postgres;

--
-- TOC entry 1565 (class 1255 OID 85498)
-- Dependencies: 11
-- Name: gbt_macad_consistent(internal, macaddr, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_consistent(internal, macaddr, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_macad_consistent';


ALTER FUNCTION public.gbt_macad_consistent(internal, macaddr, smallint) OWNER TO postgres;

--
-- TOC entry 1566 (class 1255 OID 85499)
-- Dependencies: 11
-- Name: gbt_macad_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_macad_penalty';


ALTER FUNCTION public.gbt_macad_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1567 (class 1255 OID 85500)
-- Dependencies: 11
-- Name: gbt_macad_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_macad_picksplit';


ALTER FUNCTION public.gbt_macad_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1568 (class 1255 OID 85501)
-- Dependencies: 11
-- Name: gbt_macad_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_macad_same';


ALTER FUNCTION public.gbt_macad_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1569 (class 1255 OID 85502)
-- Dependencies: 2833 11
-- Name: gbt_macad_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_macad_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_macad_union';


ALTER FUNCTION public.gbt_macad_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1570 (class 1255 OID 85503)
-- Dependencies: 11
-- Name: gbt_numeric_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_numeric_compress';


ALTER FUNCTION public.gbt_numeric_compress(internal) OWNER TO postgres;

--
-- TOC entry 1571 (class 1255 OID 85504)
-- Dependencies: 11
-- Name: gbt_numeric_consistent(internal, numeric, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_consistent(internal, numeric, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_numeric_consistent';


ALTER FUNCTION public.gbt_numeric_consistent(internal, numeric, smallint) OWNER TO postgres;

--
-- TOC entry 1572 (class 1255 OID 85505)
-- Dependencies: 11
-- Name: gbt_numeric_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_numeric_penalty';


ALTER FUNCTION public.gbt_numeric_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1573 (class 1255 OID 85506)
-- Dependencies: 11
-- Name: gbt_numeric_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_numeric_picksplit';


ALTER FUNCTION public.gbt_numeric_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1574 (class 1255 OID 85507)
-- Dependencies: 11
-- Name: gbt_numeric_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_numeric_same';


ALTER FUNCTION public.gbt_numeric_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1575 (class 1255 OID 85508)
-- Dependencies: 2849 11
-- Name: gbt_numeric_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_numeric_union(bytea, internal) RETURNS gbtreekey_var
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_numeric_union';


ALTER FUNCTION public.gbt_numeric_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1576 (class 1255 OID 85509)
-- Dependencies: 11
-- Name: gbt_oid_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_oid_compress';


ALTER FUNCTION public.gbt_oid_compress(internal) OWNER TO postgres;

--
-- TOC entry 1577 (class 1255 OID 85510)
-- Dependencies: 11
-- Name: gbt_oid_consistent(internal, oid, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_consistent(internal, oid, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_oid_consistent';


ALTER FUNCTION public.gbt_oid_consistent(internal, oid, smallint) OWNER TO postgres;

--
-- TOC entry 1578 (class 1255 OID 85511)
-- Dependencies: 11
-- Name: gbt_oid_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_oid_penalty';


ALTER FUNCTION public.gbt_oid_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1579 (class 1255 OID 85512)
-- Dependencies: 11
-- Name: gbt_oid_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_oid_picksplit';


ALTER FUNCTION public.gbt_oid_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1580 (class 1255 OID 85513)
-- Dependencies: 11
-- Name: gbt_oid_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_oid_same';


ALTER FUNCTION public.gbt_oid_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1581 (class 1255 OID 85514)
-- Dependencies: 2843 11
-- Name: gbt_oid_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_oid_union(bytea, internal) RETURNS gbtreekey8
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_oid_union';


ALTER FUNCTION public.gbt_oid_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1582 (class 1255 OID 85515)
-- Dependencies: 11
-- Name: gbt_text_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_text_compress';


ALTER FUNCTION public.gbt_text_compress(internal) OWNER TO postgres;

--
-- TOC entry 1583 (class 1255 OID 85516)
-- Dependencies: 11
-- Name: gbt_text_consistent(internal, text, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_consistent(internal, text, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_text_consistent';


ALTER FUNCTION public.gbt_text_consistent(internal, text, smallint) OWNER TO postgres;

--
-- TOC entry 1584 (class 1255 OID 85517)
-- Dependencies: 11
-- Name: gbt_text_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_text_penalty';


ALTER FUNCTION public.gbt_text_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1585 (class 1255 OID 85518)
-- Dependencies: 11
-- Name: gbt_text_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_text_picksplit';


ALTER FUNCTION public.gbt_text_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1586 (class 1255 OID 85519)
-- Dependencies: 11
-- Name: gbt_text_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_text_same';


ALTER FUNCTION public.gbt_text_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1587 (class 1255 OID 85520)
-- Dependencies: 2849 11
-- Name: gbt_text_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_text_union(bytea, internal) RETURNS gbtreekey_var
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_text_union';


ALTER FUNCTION public.gbt_text_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1588 (class 1255 OID 85523)
-- Dependencies: 11
-- Name: gbt_time_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_time_compress';


ALTER FUNCTION public.gbt_time_compress(internal) OWNER TO postgres;

--
-- TOC entry 1589 (class 1255 OID 85524)
-- Dependencies: 11
-- Name: gbt_time_consistent(internal, time without time zone, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_consistent(internal, time without time zone, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_time_consistent';


ALTER FUNCTION public.gbt_time_consistent(internal, time without time zone, smallint) OWNER TO postgres;

--
-- TOC entry 1590 (class 1255 OID 85525)
-- Dependencies: 11
-- Name: gbt_time_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_time_penalty';


ALTER FUNCTION public.gbt_time_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1591 (class 1255 OID 85526)
-- Dependencies: 11
-- Name: gbt_time_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_time_picksplit';


ALTER FUNCTION public.gbt_time_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1592 (class 1255 OID 85527)
-- Dependencies: 11
-- Name: gbt_time_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_time_same';


ALTER FUNCTION public.gbt_time_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1593 (class 1255 OID 85528)
-- Dependencies: 2833 11
-- Name: gbt_time_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_time_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_time_union';


ALTER FUNCTION public.gbt_time_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1594 (class 1255 OID 85529)
-- Dependencies: 11
-- Name: gbt_timetz_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_timetz_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_timetz_compress';


ALTER FUNCTION public.gbt_timetz_compress(internal) OWNER TO postgres;

--
-- TOC entry 1595 (class 1255 OID 85530)
-- Dependencies: 11
-- Name: gbt_timetz_consistent(internal, time with time zone, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_timetz_consistent(internal, time with time zone, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_timetz_consistent';


ALTER FUNCTION public.gbt_timetz_consistent(internal, time with time zone, smallint) OWNER TO postgres;

--
-- TOC entry 1596 (class 1255 OID 85531)
-- Dependencies: 11
-- Name: gbt_ts_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_ts_compress';


ALTER FUNCTION public.gbt_ts_compress(internal) OWNER TO postgres;

--
-- TOC entry 1597 (class 1255 OID 85532)
-- Dependencies: 11
-- Name: gbt_ts_consistent(internal, timestamp without time zone, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_consistent(internal, timestamp without time zone, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_ts_consistent';


ALTER FUNCTION public.gbt_ts_consistent(internal, timestamp without time zone, smallint) OWNER TO postgres;

--
-- TOC entry 1598 (class 1255 OID 85533)
-- Dependencies: 11
-- Name: gbt_ts_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/btree_gist', 'gbt_ts_penalty';


ALTER FUNCTION public.gbt_ts_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1599 (class 1255 OID 85534)
-- Dependencies: 11
-- Name: gbt_ts_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_ts_picksplit';


ALTER FUNCTION public.gbt_ts_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1600 (class 1255 OID 85535)
-- Dependencies: 11
-- Name: gbt_ts_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_ts_same';


ALTER FUNCTION public.gbt_ts_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1601 (class 1255 OID 85536)
-- Dependencies: 2833 11
-- Name: gbt_ts_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_ts_union(bytea, internal) RETURNS gbtreekey16
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_ts_union';


ALTER FUNCTION public.gbt_ts_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1602 (class 1255 OID 85537)
-- Dependencies: 11
-- Name: gbt_tstz_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_tstz_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_tstz_compress';


ALTER FUNCTION public.gbt_tstz_compress(internal) OWNER TO postgres;

--
-- TOC entry 1603 (class 1255 OID 85538)
-- Dependencies: 11
-- Name: gbt_tstz_consistent(internal, timestamp with time zone, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_tstz_consistent(internal, timestamp with time zone, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_tstz_consistent';


ALTER FUNCTION public.gbt_tstz_consistent(internal, timestamp with time zone, smallint) OWNER TO postgres;

--
-- TOC entry 1604 (class 1255 OID 85539)
-- Dependencies: 11
-- Name: gbt_var_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gbt_var_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/btree_gist', 'gbt_var_decompress';


ALTER FUNCTION public.gbt_var_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1605 (class 1255 OID 85540)
-- Dependencies: 11
-- Name: gc_to_sec(double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gc_to_sec(double precision) RETURNS double precision
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT CASE WHEN $1 < 0 THEN 0::float8 WHEN $1/earth() > pi() THEN 2*earth() ELSE 2*earth()*sin($1/(2*earth())) END$_$;


ALTER FUNCTION public.gc_to_sec(double precision) OWNER TO postgres;

--
-- TOC entry 1606 (class 1255 OID 85541)
-- Dependencies: 11
-- Name: gen_random_bytes(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gen_random_bytes(integer) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pg_random_bytes';


ALTER FUNCTION public.gen_random_bytes(integer) OWNER TO postgres;

--
-- TOC entry 1607 (class 1255 OID 85542)
-- Dependencies: 11
-- Name: gen_salt(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gen_salt(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pg_gen_salt';


ALTER FUNCTION public.gen_salt(text) OWNER TO postgres;

--
-- TOC entry 1608 (class 1255 OID 85543)
-- Dependencies: 11
-- Name: gen_salt(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gen_salt(text, integer) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pg_gen_salt_rounds';


ALTER FUNCTION public.gen_salt(text, integer) OWNER TO postgres;

--
-- TOC entry 1609 (class 1255 OID 85544)
-- Dependencies: 4822 11
-- Name: genesisgrupoarmado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION genesisgrupoarmado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO genesisgrupoarmado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO genesisgrupoarmado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO genesisgrupoarmado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO genesisgrupoarmado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.genesisgrupoarmado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1610 (class 1255 OID 85545)
-- Dependencies: 11
-- Name: geo_distance(point, point); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION geo_distance(point, point) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/earthdistance', 'geo_distance';


ALTER FUNCTION public.geo_distance(point, point) OWNER TO postgres;

--
-- TOC entry 1611 (class 1255 OID 85546)
-- Dependencies: 11
-- Name: georeferenciacion(character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION georeferenciacion(character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying) RETURNS character varying
    LANGUAGE sql IMMUTABLE
    AS $_$
	SELECT
	CASE
		WHEN LENGTH(TRIM($1)) != 0 AND UPPER(TRIM($1)) != 'PAIS' THEN UPPER(TRIM($1)) ||
		CASE
			WHEN LENGTH(TRIM($2)) != 0 AND UPPER(TRIM($2)) != 'DEPARTAMENTO' THEN ' - ' || UPPER(TRIM($2)) ||
			CASE
				WHEN LENGTH(TRIM($3)) != 0 AND UPPER(TRIM($3)) != 'MUNICIPIO' THEN ' - ' || UPPER(TRIM($3)) ||
				CASE
					WHEN LENGTH(TRIM($4)) != 0 THEN ' - CORREGIMIENTO: ' || UPPER(TRIM($4))
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($5)) != 0 THEN ' - VEREDA: ' || UPPER(TRIM($5))
				ELSE '' END ||

				CASE
					WHEN LENGTH(TRIM($6)) != 0 THEN ' - INSPECCION: ' || UPPER(TRIM($6))
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($7)) != 0 THEN ' - FINCA: ' || UPPER(TRIM($7))
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($8)) != 0 THEN ' - BARRIO: ' || UPPER(TRIM($8))
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($9)) != 0 THEN ' - DIRECCION: ' || UPPER(TRIM($9))
				ELSE '' END ||
				CASE
					WHEN LENGTH(TRIM($10)) != 0 THEN ' - SITIO: ' || UPPER(TRIM($10))
				ELSE '' END
			ELSE '' END
		ELSE '' END
	ELSE '' END
$_$;


ALTER FUNCTION public.georeferenciacion(character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying, character varying) OWNER TO postgres;

--
-- TOC entry 1612 (class 1255 OID 85547)
-- Dependencies: 4822 11
-- Name: georeferenciacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION georeferenciacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO georeferenciacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO georeferenciacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO georeferenciacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO georeferenciacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.georeferenciacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8922 (class 0 OID 0)
-- Dependencies: 1612
-- Name: FUNCTION georeferenciacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION georeferenciacion_audit_fun() IS 'COMMENT ON TRIGGER georeferenciacion_trigger_fun ON georeferenciacion IS ''Tabla de georeferenciacion
';


--
-- TOC entry 1613 (class 1255 OID 85548)
-- Dependencies: 4822 11
-- Name: georeferenciaciongrupoarmado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION georeferenciaciongrupoarmado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO georeferenciaciongrupoarmado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO georeferenciaciongrupoarmado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO georeferenciaciongrupoarmado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO georeferenciaciongrupoarmado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.georeferenciaciongrupoarmado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1614 (class 1255 OID 85549)
-- Dependencies: 4822 11
-- Name: getCargo(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION "getCargo"(text) RETURNS text
    LANGUAGE plpgsql
    AS $_$

DECLARE
resultado text;
BEGIN

SELECT cargo INTO resultado FROM public.cargo WHERE idcargo = (SELECT idcargo FROM public.usuario WHERE "login" = $1);
RETURN resultado;

END
$_$;


ALTER FUNCTION public."getCargo"(text) OWNER TO postgres;

--
-- TOC entry 1615 (class 1255 OID 85550)
-- Dependencies: 4822 11
-- Name: getDespacho(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION "getDespacho"(integer) RETURNS text
    LANGUAGE plpgsql
    AS $_$

DECLARE
resultado text;
BEGIN

SELECT nombreautoridad INTO resultado FROM public.autoridad WHERE idautoridad = $1;
RETURN resultado;

END
$_$;


ALTER FUNCTION public."getDespacho"(integer) OWNER TO postgres;

--
-- TOC entry 1616 (class 1255 OID 85551)
-- Dependencies: 4822 11
-- Name: getPerentesco(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION "getPerentesco"(integer) RETURNS text
    LANGUAGE plpgsql
    AS $_$

DECLARE
resultado text;
BEGIN

SELECT tiporelacionparentesco INTO resultado FROM public.tiporelacionparentesco WHERE idtiporelacionparentesco = $1;
RETURN resultado;

END
$_$;


ALTER FUNCTION public."getPerentesco"(integer) OWNER TO postgres;

--
-- TOC entry 1617 (class 1255 OID 85552)
-- Dependencies: 4822 11
-- Name: getPerentescoInverso(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION "getPerentescoInverso"(integer) RETURNS text
    LANGUAGE plpgsql
    AS $_$

DECLARE
resultado text;
BEGIN

SELECT parentescoinverso INTO resultado FROM public.tiporelacionparentesco WHERE idtiporelacionparentesco = $1;
RETURN resultado;

END
$_$;


ALTER FUNCTION public."getPerentescoInverso"(integer) OWNER TO postgres;

--
-- TOC entry 1618 (class 1255 OID 85553)
-- Dependencies: 4822 11
-- Name: getTipoRelacionEvento(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION "getTipoRelacionEvento"(integer) RETURNS text
    LANGUAGE plpgsql
    AS $_$

DECLARE
resultado text;
BEGIN

SELECT descripcion INTO resultado FROM public.tiporelacionevento WHERE idtiporelacionevento = $1;
RETURN resultado;

END
$_$;


ALTER FUNCTION public."getTipoRelacionEvento"(integer) OWNER TO postgres;

--
-- TOC entry 1619 (class 1255 OID 85554)
-- Dependencies: 11
-- Name: get_raw_page(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION get_raw_page(text, integer) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'get_raw_page';


ALTER FUNCTION public.get_raw_page(text, integer) OWNER TO postgres;

--
-- TOC entry 1620 (class 1255 OID 85555)
-- Dependencies: 11
-- Name: get_timetravel(name); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION get_timetravel(name) RETURNS integer
    LANGUAGE c STRICT
    AS '$libdir/timetravel', 'get_timetravel';


ALTER FUNCTION public.get_timetravel(name) OWNER TO postgres;

--
-- TOC entry 1621 (class 1255 OID 85556)
-- Dependencies: 11
-- Name: ghstore_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_compress';


ALTER FUNCTION public.ghstore_compress(internal) OWNER TO postgres;

--
-- TOC entry 1622 (class 1255 OID 85557)
-- Dependencies: 11
-- Name: ghstore_consistent(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_consistent(internal, internal, integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_consistent';


ALTER FUNCTION public.ghstore_consistent(internal, internal, integer) OWNER TO postgres;

--
-- TOC entry 1623 (class 1255 OID 85558)
-- Dependencies: 11
-- Name: ghstore_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_decompress';


ALTER FUNCTION public.ghstore_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1624 (class 1255 OID 85559)
-- Dependencies: 11
-- Name: ghstore_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'ghstore_penalty';


ALTER FUNCTION public.ghstore_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1625 (class 1255 OID 85560)
-- Dependencies: 11
-- Name: ghstore_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_picksplit';


ALTER FUNCTION public.ghstore_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1626 (class 1255 OID 85561)
-- Dependencies: 11
-- Name: ghstore_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_same';


ALTER FUNCTION public.ghstore_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1627 (class 1255 OID 85562)
-- Dependencies: 11
-- Name: ghstore_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ghstore_union(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'ghstore_union';


ALTER FUNCTION public.ghstore_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1628 (class 1255 OID 85563)
-- Dependencies: 11
-- Name: gin_consistent_hstore(internal, smallint, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_consistent_hstore(internal, smallint, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'gin_consistent_hstore';


ALTER FUNCTION public.gin_consistent_hstore(internal, smallint, internal) OWNER TO postgres;

--
-- TOC entry 1629 (class 1255 OID 85564)
-- Dependencies: 11
-- Name: gin_extract_hstore(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_extract_hstore(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'gin_extract_hstore';


ALTER FUNCTION public.gin_extract_hstore(internal, internal) OWNER TO postgres;

--
-- TOC entry 1630 (class 1255 OID 85565)
-- Dependencies: 11
-- Name: gin_extract_hstore_query(internal, internal, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_extract_hstore_query(internal, internal, smallint) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'gin_extract_hstore_query';


ALTER FUNCTION public.gin_extract_hstore_query(internal, internal, smallint) OWNER TO postgres;

--
-- TOC entry 1631 (class 1255 OID 85566)
-- Dependencies: 11
-- Name: gin_extract_trgm(text, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_extract_trgm(text, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gin_extract_trgm';


ALTER FUNCTION public.gin_extract_trgm(text, internal) OWNER TO postgres;

--
-- TOC entry 1632 (class 1255 OID 85567)
-- Dependencies: 11
-- Name: gin_extract_trgm(text, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_extract_trgm(text, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gin_extract_trgm';


ALTER FUNCTION public.gin_extract_trgm(text, internal, internal) OWNER TO postgres;

--
-- TOC entry 1633 (class 1255 OID 85568)
-- Dependencies: 11
-- Name: gin_trgm_consistent(internal, internal, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gin_trgm_consistent(internal, internal, text) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gin_trgm_consistent';


ALTER FUNCTION public.gin_trgm_consistent(internal, internal, text) OWNER TO postgres;

--
-- TOC entry 1634 (class 1255 OID 85569)
-- Dependencies: 11
-- Name: ginint4_consistent(internal, smallint, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ginint4_consistent(internal, smallint, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'ginint4_consistent';


ALTER FUNCTION public.ginint4_consistent(internal, smallint, internal) OWNER TO postgres;

--
-- TOC entry 1635 (class 1255 OID 85570)
-- Dependencies: 11
-- Name: ginint4_queryextract(internal, internal, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ginint4_queryextract(internal, internal, smallint) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/_int', 'ginint4_queryextract';


ALTER FUNCTION public.ginint4_queryextract(internal, internal, smallint) OWNER TO postgres;

--
-- TOC entry 1640 (class 1255 OID 85571)
-- Dependencies: 11
-- Name: grupoarmado(character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION grupoarmado(character varying, character varying, character varying, character varying) RETURNS character varying
    LANGUAGE sql IMMUTABLE
    AS $_$
-- AUTOR: JIMMY ALEXANDER CRUZ QUINTERO
-- FUNCION QUE RETORNA EL GRUPO ARMADO SEPARADO POR '-'
-- DATE: 08 DE JUNIO DE 2010
	SELECT
	CASE
		WHEN LENGTH(TRIM($1)) != 0 AND UPPER(TRIM($1)) != 'GRUPO ARMADO' THEN UPPER(TRIM($1)) ||
		CASE
			WHEN LENGTH(TRIM($2)) != 0 AND UPPER(TRIM($2)) != 'ESTRUCTURA' THEN ' - ' || UPPER(TRIM($2)) ||
			CASE
				WHEN LENGTH(TRIM($2)) != 0 AND UPPER(TRIM($3)) != 'BLOQUE' THEN ' - ' || UPPER(TRIM($3)) ||
				CASE
					WHEN LENGTH(TRIM($4)) != 0 AND UPPER(TRIM($4)) != 'FRENTE' THEN ' - ' || UPPER(TRIM($4))
					ELSE '' END
				ELSE '' END
			ELSE '' END
		ELSE '' END
$_$;


ALTER FUNCTION public.grupoarmado(character varying, character varying, character varying, character varying) OWNER TO postgres;

--
-- TOC entry 8923 (class 0 OID 0)
-- Dependencies: 1640
-- Name: FUNCTION grupoarmado(character varying, character varying, character varying, character varying); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION grupoarmado(character varying, character varying, character varying, character varying) IS 'FUNCION QUE RETORNA EL GRUPO ARMADO SEPARADO POR ''-''';


--
-- TOC entry 1641 (class 1255 OID 85572)
-- Dependencies: 4822 11
-- Name: grupos_etnicos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION grupos_etnicos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO grupos_etnicos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO grupos_etnicos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO grupos_etnicos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO grupos_etnicos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.grupos_etnicos_audit_fun() OWNER TO postgres;

--
-- TOC entry 1642 (class 1255 OID 85573)
-- Dependencies: 11
-- Name: gseg_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_compress';


ALTER FUNCTION public.gseg_compress(internal) OWNER TO postgres;

--
-- TOC entry 1643 (class 1255 OID 85574)
-- Dependencies: 2922 11
-- Name: gseg_consistent(internal, seg, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_consistent(internal, seg, integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_consistent';


ALTER FUNCTION public.gseg_consistent(internal, seg, integer) OWNER TO postgres;

--
-- TOC entry 1644 (class 1255 OID 85575)
-- Dependencies: 11
-- Name: gseg_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_decompress';


ALTER FUNCTION public.gseg_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1645 (class 1255 OID 85576)
-- Dependencies: 11
-- Name: gseg_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'gseg_penalty';


ALTER FUNCTION public.gseg_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1646 (class 1255 OID 85577)
-- Dependencies: 11
-- Name: gseg_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_picksplit';


ALTER FUNCTION public.gseg_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1647 (class 1255 OID 85578)
-- Dependencies: 2922 2922 11
-- Name: gseg_same(seg, seg, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_same(seg, seg, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_same';


ALTER FUNCTION public.gseg_same(seg, seg, internal) OWNER TO postgres;

--
-- TOC entry 1648 (class 1255 OID 85579)
-- Dependencies: 2922 11
-- Name: gseg_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gseg_union(internal, internal) RETURNS seg
    LANGUAGE c IMMUTABLE
    AS '$libdir/seg', 'gseg_union';


ALTER FUNCTION public.gseg_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1649 (class 1255 OID 85580)
-- Dependencies: 11
-- Name: gtrgm_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_compress';


ALTER FUNCTION public.gtrgm_compress(internal) OWNER TO postgres;

--
-- TOC entry 1650 (class 1255 OID 85581)
-- Dependencies: 2841 11
-- Name: gtrgm_consistent(gtrgm, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_consistent(gtrgm, internal, integer) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_consistent';


ALTER FUNCTION public.gtrgm_consistent(gtrgm, internal, integer) OWNER TO postgres;

--
-- TOC entry 1651 (class 1255 OID 85582)
-- Dependencies: 11
-- Name: gtrgm_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_decompress';


ALTER FUNCTION public.gtrgm_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1652 (class 1255 OID 85583)
-- Dependencies: 11
-- Name: gtrgm_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pg_trgm', 'gtrgm_penalty';


ALTER FUNCTION public.gtrgm_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1653 (class 1255 OID 85584)
-- Dependencies: 11
-- Name: gtrgm_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_picksplit';


ALTER FUNCTION public.gtrgm_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1654 (class 1255 OID 85585)
-- Dependencies: 2841 2841 11
-- Name: gtrgm_same(gtrgm, gtrgm, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_same';


ALTER FUNCTION public.gtrgm_same(gtrgm, gtrgm, internal) OWNER TO postgres;

--
-- TOC entry 1655 (class 1255 OID 85586)
-- Dependencies: 11
-- Name: gtrgm_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION gtrgm_union(bytea, internal) RETURNS integer[]
    LANGUAGE c IMMUTABLE
    AS '$libdir/pg_trgm', 'gtrgm_union';


ALTER FUNCTION public.gtrgm_union(bytea, internal) OWNER TO postgres;

--
-- TOC entry 1656 (class 1255 OID 85587)
-- Dependencies: 2823 11
-- Name: hashean13(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashean13(ean13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashean13(ean13) OWNER TO postgres;

--
-- TOC entry 1657 (class 1255 OID 85588)
-- Dependencies: 2863 11
-- Name: hashisbn(isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashisbn(isbn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashisbn(isbn) OWNER TO postgres;

--
-- TOC entry 1658 (class 1255 OID 85589)
-- Dependencies: 2867 11
-- Name: hashisbn13(isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashisbn13(isbn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashisbn13(isbn13) OWNER TO postgres;

--
-- TOC entry 1659 (class 1255 OID 85590)
-- Dependencies: 2884 11
-- Name: hashismn(ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashismn(ismn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashismn(ismn) OWNER TO postgres;

--
-- TOC entry 1660 (class 1255 OID 85591)
-- Dependencies: 2890 11
-- Name: hashismn13(ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashismn13(ismn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashismn13(ismn13) OWNER TO postgres;

--
-- TOC entry 1661 (class 1255 OID 85592)
-- Dependencies: 2894 11
-- Name: hashissn(issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashissn(issn) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashissn(issn) OWNER TO postgres;

--
-- TOC entry 1662 (class 1255 OID 85593)
-- Dependencies: 2900 11
-- Name: hashissn13(issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashissn13(issn13) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashissn13(issn13) OWNER TO postgres;

--
-- TOC entry 1663 (class 1255 OID 85594)
-- Dependencies: 2932 11
-- Name: hashupc(upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hashupc(upc) RETURNS integer
    LANGUAGE internal IMMUTABLE STRICT
    AS $$hashint8$$;


ALTER FUNCTION public.hashupc(upc) OWNER TO postgres;

--
-- TOC entry 1664 (class 1255 OID 85595)
-- Dependencies: 11
-- Name: heap_page_items(bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION heap_page_items(page bytea, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 smallint, OUT t_infomask smallint, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid) RETURNS SETOF record
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'heap_page_items';


ALTER FUNCTION public.heap_page_items(page bytea, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 smallint, OUT t_infomask smallint, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid) OWNER TO postgres;

--
-- TOC entry 1665 (class 1255 OID 85596)
-- Dependencies: 4822 11
-- Name: hecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO hecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO hecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO hecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO hecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.hecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 8924 (class 0 OID 0)
-- Dependencies: 1665
-- Name: FUNCTION hecho_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION hecho_audit_fun() IS 'COMMENT ON TRIGGER hecho_trigger_fun ON hecho IS ''Tabla circunstancias del hecho'';
';


--
-- TOC entry 1667 (class 1255 OID 85597)
-- Dependencies: 4822 11
-- Name: historialpersonaga_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historialpersonaga_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO historialpersonaga_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO historialpersonaga_audit SELECT 'U', now(), NEW.*;
            INSERT INTO historialpersonaga_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historialpersonaga_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historialpersonaga_audit_fun() OWNER TO postgres;

--
-- TOC entry 1668 (class 1255 OID 85598)
-- Dependencies: 4822 11
-- Name: historialreclusion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historialreclusion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO historialreclusion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO historialreclusion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO historialreclusion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historialreclusion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historialreclusion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1669 (class 1255 OID 85599)
-- Dependencies: 4822 11
-- Name: historialubicacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historialubicacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO historialubicacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO historialubicacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO historialubicacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historialubicacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historialubicacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 8925 (class 0 OID 0)
-- Dependencies: 1669
-- Name: FUNCTION historialubicacion_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION historialubicacion_audit_fun() IS 'COMMENT ON TRIGGER historialubicacion_trigger_fun ON historialubicacion IS ''historialubicacion'';
';


--
-- TOC entry 1670 (class 1255 OID 85600)
-- Dependencies: 4822 11
-- Name: historicodocumentocarpeta_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historicodocumentocarpeta_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'UPDATE') THEN
            INSERT INTO historicodocumentocarpeta SELECT now(), NEW.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historicodocumentocarpeta SELECT now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historicodocumentocarpeta_fun() OWNER TO postgres;

--
-- TOC entry 1671 (class 1255 OID 85601)
-- Dependencies: 4822 11
-- Name: historicoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historicoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO historicoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO historicoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO historicoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historicoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historicoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 1672 (class 1255 OID 85602)
-- Dependencies: 4822 11
-- Name: historicorelacioncarpetahechoevento_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION historicorelacioncarpetahechoevento_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'UPDATE') THEN
            INSERT INTO historicorelacioncarpetahechoevento SELECT now(), NEW.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO historicorelacioncarpetahechoevento SELECT now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.historicorelacioncarpetahechoevento_fun() OWNER TO postgres;

--
-- TOC entry 1673 (class 1255 OID 85603)
-- Dependencies: 11
-- Name: hmac(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_hmac';


ALTER FUNCTION public.hmac(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1674 (class 1255 OID 85604)
-- Dependencies: 11
-- Name: hmac(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hmac(text, text, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pg_hmac';


ALTER FUNCTION public.hmac(text, text, text) OWNER TO postgres;

--
-- TOC entry 1675 (class 1255 OID 85605)
-- Dependencies: 2859 2859 2859 11
-- Name: hs_concat(hstore, hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hs_concat(hstore, hstore) RETURNS hstore
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'hs_concat';


ALTER FUNCTION public.hs_concat(hstore, hstore) OWNER TO postgres;

--
-- TOC entry 1676 (class 1255 OID 85606)
-- Dependencies: 2859 2859 11
-- Name: hs_contained(hstore, hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hs_contained(hstore, hstore) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'hs_contained';


ALTER FUNCTION public.hs_contained(hstore, hstore) OWNER TO postgres;

--
-- TOC entry 1677 (class 1255 OID 85607)
-- Dependencies: 2859 2859 11
-- Name: hs_contains(hstore, hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION hs_contains(hstore, hstore) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'hs_contains';


ALTER FUNCTION public.hs_contains(hstore, hstore) OWNER TO postgres;

--
-- TOC entry 1678 (class 1255 OID 85608)
-- Dependencies: 11
-- Name: icount(integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION icount(integer[]) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'icount';


ALTER FUNCTION public.icount(integer[]) OWNER TO postgres;

--
-- TOC entry 1679 (class 1255 OID 85609)
-- Dependencies: 4822 11
-- Name: identificacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION identificacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO identificacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO identificacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO identificacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO identificacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.identificacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1680 (class 1255 OID 85610)
-- Dependencies: 4822 11
-- Name: identificaciongrupoarmado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION identificaciongrupoarmado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO identificaciongrupoarmado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO identificaciongrupoarmado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO identificaciongrupoarmado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO identificaciongrupoarmado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.identificaciongrupoarmado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1681 (class 1255 OID 85611)
-- Dependencies: 11
-- Name: idx(integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION idx(integer[], integer) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'idx';


ALTER FUNCTION public.idx(integer[], integer) OWNER TO postgres;

--
-- TOC entry 1682 (class 1255 OID 85612)
-- Dependencies: 2882 2882 11
-- Name: index(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION index(ltree, ltree) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_index';


ALTER FUNCTION public.index(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1683 (class 1255 OID 85613)
-- Dependencies: 2882 2882 11
-- Name: index(ltree, ltree, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION index(ltree, ltree, integer) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_index';


ALTER FUNCTION public.index(ltree, ltree, integer) OWNER TO postgres;

--
-- TOC entry 1684 (class 1255 OID 85614)
-- Dependencies: 11
-- Name: insert_username(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION insert_username() RETURNS trigger
    LANGUAGE c
    AS '$libdir/insert_username', 'insert_username';


ALTER FUNCTION public.insert_username() OWNER TO postgres;

--
-- TOC entry 1636 (class 1255 OID 85615)
-- Dependencies: 11
-- Name: intarray_del_elem(integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intarray_del_elem(integer[], integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intarray_del_elem';


ALTER FUNCTION public.intarray_del_elem(integer[], integer) OWNER TO postgres;

--
-- TOC entry 1637 (class 1255 OID 85616)
-- Dependencies: 11
-- Name: intarray_push_array(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intarray_push_array(integer[], integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intarray_push_array';


ALTER FUNCTION public.intarray_push_array(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 1638 (class 1255 OID 85617)
-- Dependencies: 11
-- Name: intarray_push_elem(integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intarray_push_elem(integer[], integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intarray_push_elem';


ALTER FUNCTION public.intarray_push_elem(integer[], integer) OWNER TO postgres;

--
-- TOC entry 1639 (class 1255 OID 85618)
-- Dependencies: 11
-- Name: intset(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intset(integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intset';


ALTER FUNCTION public.intset(integer) OWNER TO postgres;

--
-- TOC entry 1666 (class 1255 OID 85619)
-- Dependencies: 11
-- Name: intset_subtract(integer[], integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intset_subtract(integer[], integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intset_subtract';


ALTER FUNCTION public.intset_subtract(integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 1685 (class 1255 OID 85620)
-- Dependencies: 11
-- Name: intset_union_elem(integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION intset_union_elem(integer[], integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'intset_union_elem';


ALTER FUNCTION public.intset_union_elem(integer[], integer) OWNER TO postgres;

--
-- TOC entry 1686 (class 1255 OID 85621)
-- Dependencies: 2823 11
-- Name: is_valid(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(ean13) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(ean13) OWNER TO postgres;

--
-- TOC entry 1687 (class 1255 OID 85622)
-- Dependencies: 2863 11
-- Name: is_valid(isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(isbn) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(isbn) OWNER TO postgres;

--
-- TOC entry 1688 (class 1255 OID 85623)
-- Dependencies: 2867 11
-- Name: is_valid(isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(isbn13) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(isbn13) OWNER TO postgres;

--
-- TOC entry 1689 (class 1255 OID 85624)
-- Dependencies: 2884 11
-- Name: is_valid(ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(ismn) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(ismn) OWNER TO postgres;

--
-- TOC entry 1690 (class 1255 OID 85625)
-- Dependencies: 2890 11
-- Name: is_valid(ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(ismn13) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(ismn13) OWNER TO postgres;

--
-- TOC entry 1691 (class 1255 OID 85626)
-- Dependencies: 2894 11
-- Name: is_valid(issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(issn) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(issn) OWNER TO postgres;

--
-- TOC entry 1692 (class 1255 OID 85627)
-- Dependencies: 2900 11
-- Name: is_valid(issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(issn13) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(issn13) OWNER TO postgres;

--
-- TOC entry 1693 (class 1255 OID 85628)
-- Dependencies: 2932 11
-- Name: is_valid(upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION is_valid(upc) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'is_valid';


ALTER FUNCTION public.is_valid(upc) OWNER TO postgres;

--
-- TOC entry 1694 (class 1255 OID 85629)
-- Dependencies: 2823 2863 11
-- Name: isbn(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isbn(ean13) RETURNS isbn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isbn_cast_from_ean13';


ALTER FUNCTION public.isbn(ean13) OWNER TO postgres;

--
-- TOC entry 1695 (class 1255 OID 85630)
-- Dependencies: 2823 2867 11
-- Name: isbn13(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isbn13(ean13) RETURNS isbn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'isbn_cast_from_ean13';


ALTER FUNCTION public.isbn13(ean13) OWNER TO postgres;

--
-- TOC entry 1696 (class 1255 OID 85631)
-- Dependencies: 2859 11
-- Name: isdefined(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isdefined(hstore, text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'defined';


ALTER FUNCTION public.isdefined(hstore, text) OWNER TO postgres;

--
-- TOC entry 1697 (class 1255 OID 85632)
-- Dependencies: 2859 11
-- Name: isexists(hstore, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isexists(hstore, text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'exists';


ALTER FUNCTION public.isexists(hstore, text) OWNER TO postgres;

--
-- TOC entry 1698 (class 1255 OID 85633)
-- Dependencies: 2823 2884 11
-- Name: ismn(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ismn(ean13) RETURNS ismn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ismn_cast_from_ean13';


ALTER FUNCTION public.ismn(ean13) OWNER TO postgres;

--
-- TOC entry 1699 (class 1255 OID 85634)
-- Dependencies: 2823 2890 11
-- Name: ismn13(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ismn13(ean13) RETURNS ismn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'ismn_cast_from_ean13';


ALTER FUNCTION public.ismn13(ean13) OWNER TO postgres;

--
-- TOC entry 1700 (class 1255 OID 85635)
-- Dependencies: 11
-- Name: isn_weak(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_weak() RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'weak_input_status';


ALTER FUNCTION public.isn_weak() OWNER TO postgres;

--
-- TOC entry 1701 (class 1255 OID 85636)
-- Dependencies: 11
-- Name: isn_weak(boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isn_weak(boolean) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'accept_weak_input';


ALTER FUNCTION public.isn_weak(boolean) OWNER TO postgres;

--
-- TOC entry 1702 (class 1255 OID 85637)
-- Dependencies: 2823 2823 11
-- Name: isneq(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1703 (class 1255 OID 85638)
-- Dependencies: 2863 2823 11
-- Name: isneq(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1704 (class 1255 OID 85639)
-- Dependencies: 2867 2823 11
-- Name: isneq(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1705 (class 1255 OID 85640)
-- Dependencies: 2884 2823 11
-- Name: isneq(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1706 (class 1255 OID 85641)
-- Dependencies: 2890 2823 11
-- Name: isneq(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1707 (class 1255 OID 85642)
-- Dependencies: 2894 2823 11
-- Name: isneq(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1708 (class 1255 OID 85643)
-- Dependencies: 2900 2823 11
-- Name: isneq(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1709 (class 1255 OID 85644)
-- Dependencies: 2932 2823 11
-- Name: isneq(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1710 (class 1255 OID 85645)
-- Dependencies: 2823 2863 11
-- Name: isneq(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1711 (class 1255 OID 85646)
-- Dependencies: 2863 2863 11
-- Name: isneq(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1712 (class 1255 OID 85647)
-- Dependencies: 2867 2863 11
-- Name: isneq(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1713 (class 1255 OID 85648)
-- Dependencies: 2823 2867 11
-- Name: isneq(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1714 (class 1255 OID 85649)
-- Dependencies: 2863 2867 11
-- Name: isneq(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1715 (class 1255 OID 85650)
-- Dependencies: 2867 2867 11
-- Name: isneq(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1716 (class 1255 OID 85651)
-- Dependencies: 2823 2884 11
-- Name: isneq(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1717 (class 1255 OID 85652)
-- Dependencies: 2884 2884 11
-- Name: isneq(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1718 (class 1255 OID 85653)
-- Dependencies: 2890 2884 11
-- Name: isneq(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1719 (class 1255 OID 85654)
-- Dependencies: 2823 2890 11
-- Name: isneq(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1720 (class 1255 OID 85655)
-- Dependencies: 2884 2890 11
-- Name: isneq(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1721 (class 1255 OID 85656)
-- Dependencies: 2890 2890 11
-- Name: isneq(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1722 (class 1255 OID 85657)
-- Dependencies: 2823 2894 11
-- Name: isneq(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1723 (class 1255 OID 85658)
-- Dependencies: 2894 2894 11
-- Name: isneq(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn, issn) OWNER TO postgres;

--
-- TOC entry 1724 (class 1255 OID 85659)
-- Dependencies: 2900 2894 11
-- Name: isneq(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1725 (class 1255 OID 85660)
-- Dependencies: 2823 2900 11
-- Name: isneq(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1370 (class 1255 OID 85661)
-- Dependencies: 2894 2900 11
-- Name: isneq(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1371 (class 1255 OID 85662)
-- Dependencies: 2900 2900 11
-- Name: isneq(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1372 (class 1255 OID 85663)
-- Dependencies: 2823 2932 11
-- Name: isneq(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1373 (class 1255 OID 85664)
-- Dependencies: 2932 2932 11
-- Name: isneq(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isneq(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8eq$$;


ALTER FUNCTION public.isneq(upc, upc) OWNER TO postgres;

--
-- TOC entry 1474 (class 1255 OID 85665)
-- Dependencies: 2823 2823 11
-- Name: isnge(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1492 (class 1255 OID 85666)
-- Dependencies: 2863 2823 11
-- Name: isnge(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1726 (class 1255 OID 85667)
-- Dependencies: 2867 2823 11
-- Name: isnge(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1727 (class 1255 OID 85668)
-- Dependencies: 2884 2823 11
-- Name: isnge(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1728 (class 1255 OID 85669)
-- Dependencies: 2890 2823 11
-- Name: isnge(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1729 (class 1255 OID 85670)
-- Dependencies: 2894 2823 11
-- Name: isnge(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1730 (class 1255 OID 85671)
-- Dependencies: 2900 2823 11
-- Name: isnge(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1731 (class 1255 OID 85672)
-- Dependencies: 2932 2823 11
-- Name: isnge(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1732 (class 1255 OID 85673)
-- Dependencies: 2823 2863 11
-- Name: isnge(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1733 (class 1255 OID 85674)
-- Dependencies: 2863 2863 11
-- Name: isnge(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1734 (class 1255 OID 85675)
-- Dependencies: 2867 2863 11
-- Name: isnge(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1735 (class 1255 OID 85676)
-- Dependencies: 2823 2867 11
-- Name: isnge(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1736 (class 1255 OID 85677)
-- Dependencies: 2863 2867 11
-- Name: isnge(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1737 (class 1255 OID 85678)
-- Dependencies: 2867 2867 11
-- Name: isnge(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1738 (class 1255 OID 85679)
-- Dependencies: 2823 2884 11
-- Name: isnge(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1739 (class 1255 OID 85680)
-- Dependencies: 2884 2884 11
-- Name: isnge(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1740 (class 1255 OID 85681)
-- Dependencies: 2890 2884 11
-- Name: isnge(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1741 (class 1255 OID 85682)
-- Dependencies: 2823 2890 11
-- Name: isnge(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1742 (class 1255 OID 85683)
-- Dependencies: 2884 2890 11
-- Name: isnge(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1743 (class 1255 OID 85684)
-- Dependencies: 2890 2890 11
-- Name: isnge(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1744 (class 1255 OID 85685)
-- Dependencies: 2823 2894 11
-- Name: isnge(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1745 (class 1255 OID 85686)
-- Dependencies: 2894 2894 11
-- Name: isnge(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn, issn) OWNER TO postgres;

--
-- TOC entry 1746 (class 1255 OID 85687)
-- Dependencies: 2900 2894 11
-- Name: isnge(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1747 (class 1255 OID 85688)
-- Dependencies: 2823 2900 11
-- Name: isnge(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1748 (class 1255 OID 85689)
-- Dependencies: 2894 2900 11
-- Name: isnge(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1749 (class 1255 OID 85690)
-- Dependencies: 2900 2900 11
-- Name: isnge(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1750 (class 1255 OID 85691)
-- Dependencies: 2823 2932 11
-- Name: isnge(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1751 (class 1255 OID 85692)
-- Dependencies: 2932 2932 11
-- Name: isnge(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnge(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ge$$;


ALTER FUNCTION public.isnge(upc, upc) OWNER TO postgres;

--
-- TOC entry 1752 (class 1255 OID 85693)
-- Dependencies: 2823 2823 11
-- Name: isngt(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1753 (class 1255 OID 85694)
-- Dependencies: 2863 2823 11
-- Name: isngt(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1754 (class 1255 OID 85695)
-- Dependencies: 2867 2823 11
-- Name: isngt(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1755 (class 1255 OID 85696)
-- Dependencies: 2884 2823 11
-- Name: isngt(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1756 (class 1255 OID 85697)
-- Dependencies: 2890 2823 11
-- Name: isngt(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1757 (class 1255 OID 85698)
-- Dependencies: 2894 2823 11
-- Name: isngt(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1758 (class 1255 OID 85699)
-- Dependencies: 2900 2823 11
-- Name: isngt(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1759 (class 1255 OID 85700)
-- Dependencies: 2932 2823 11
-- Name: isngt(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1760 (class 1255 OID 85701)
-- Dependencies: 2823 2863 11
-- Name: isngt(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1761 (class 1255 OID 85702)
-- Dependencies: 2863 2863 11
-- Name: isngt(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1762 (class 1255 OID 85703)
-- Dependencies: 2867 2863 11
-- Name: isngt(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1763 (class 1255 OID 85704)
-- Dependencies: 2823 2867 11
-- Name: isngt(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1764 (class 1255 OID 85705)
-- Dependencies: 2863 2867 11
-- Name: isngt(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1765 (class 1255 OID 85706)
-- Dependencies: 2867 2867 11
-- Name: isngt(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1766 (class 1255 OID 85707)
-- Dependencies: 2823 2884 11
-- Name: isngt(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1767 (class 1255 OID 85708)
-- Dependencies: 2884 2884 11
-- Name: isngt(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1768 (class 1255 OID 85709)
-- Dependencies: 2890 2884 11
-- Name: isngt(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1769 (class 1255 OID 85710)
-- Dependencies: 2823 2890 11
-- Name: isngt(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1770 (class 1255 OID 85711)
-- Dependencies: 2884 2890 11
-- Name: isngt(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1771 (class 1255 OID 85712)
-- Dependencies: 2890 2890 11
-- Name: isngt(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1772 (class 1255 OID 85713)
-- Dependencies: 2823 2894 11
-- Name: isngt(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1773 (class 1255 OID 85714)
-- Dependencies: 2894 2894 11
-- Name: isngt(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn, issn) OWNER TO postgres;

--
-- TOC entry 1774 (class 1255 OID 85715)
-- Dependencies: 2900 2894 11
-- Name: isngt(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1775 (class 1255 OID 85716)
-- Dependencies: 2823 2900 11
-- Name: isngt(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1776 (class 1255 OID 85717)
-- Dependencies: 2894 2900 11
-- Name: isngt(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1777 (class 1255 OID 85718)
-- Dependencies: 2900 2900 11
-- Name: isngt(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1778 (class 1255 OID 85719)
-- Dependencies: 2823 2932 11
-- Name: isngt(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1779 (class 1255 OID 85720)
-- Dependencies: 2932 2932 11
-- Name: isngt(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isngt(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8gt$$;


ALTER FUNCTION public.isngt(upc, upc) OWNER TO postgres;

--
-- TOC entry 1780 (class 1255 OID 85721)
-- Dependencies: 2823 2823 11
-- Name: isnle(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1781 (class 1255 OID 85722)
-- Dependencies: 2863 2823 11
-- Name: isnle(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1782 (class 1255 OID 85723)
-- Dependencies: 2867 2823 11
-- Name: isnle(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1783 (class 1255 OID 85724)
-- Dependencies: 2884 2823 11
-- Name: isnle(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1784 (class 1255 OID 85725)
-- Dependencies: 2890 2823 11
-- Name: isnle(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1785 (class 1255 OID 85726)
-- Dependencies: 2894 2823 11
-- Name: isnle(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1786 (class 1255 OID 85727)
-- Dependencies: 2900 2823 11
-- Name: isnle(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1787 (class 1255 OID 85728)
-- Dependencies: 2932 2823 11
-- Name: isnle(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1788 (class 1255 OID 85729)
-- Dependencies: 2823 2863 11
-- Name: isnle(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1789 (class 1255 OID 85730)
-- Dependencies: 2863 2863 11
-- Name: isnle(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1790 (class 1255 OID 85731)
-- Dependencies: 2867 2863 11
-- Name: isnle(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1791 (class 1255 OID 85732)
-- Dependencies: 2823 2867 11
-- Name: isnle(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1792 (class 1255 OID 85733)
-- Dependencies: 2863 2867 11
-- Name: isnle(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1793 (class 1255 OID 85734)
-- Dependencies: 2867 2867 11
-- Name: isnle(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1794 (class 1255 OID 85735)
-- Dependencies: 2823 2884 11
-- Name: isnle(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1795 (class 1255 OID 85736)
-- Dependencies: 2884 2884 11
-- Name: isnle(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1796 (class 1255 OID 85737)
-- Dependencies: 2890 2884 11
-- Name: isnle(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1797 (class 1255 OID 85738)
-- Dependencies: 2823 2890 11
-- Name: isnle(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1798 (class 1255 OID 85739)
-- Dependencies: 2884 2890 11
-- Name: isnle(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1799 (class 1255 OID 85740)
-- Dependencies: 2890 2890 11
-- Name: isnle(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1800 (class 1255 OID 85741)
-- Dependencies: 2823 2894 11
-- Name: isnle(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1801 (class 1255 OID 85742)
-- Dependencies: 2894 2894 11
-- Name: isnle(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn, issn) OWNER TO postgres;

--
-- TOC entry 1802 (class 1255 OID 85743)
-- Dependencies: 2900 2894 11
-- Name: isnle(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1803 (class 1255 OID 85744)
-- Dependencies: 2823 2900 11
-- Name: isnle(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1804 (class 1255 OID 85745)
-- Dependencies: 2894 2900 11
-- Name: isnle(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1805 (class 1255 OID 85746)
-- Dependencies: 2900 2900 11
-- Name: isnle(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1806 (class 1255 OID 85747)
-- Dependencies: 2823 2932 11
-- Name: isnle(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1807 (class 1255 OID 85748)
-- Dependencies: 2932 2932 11
-- Name: isnle(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnle(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8le$$;


ALTER FUNCTION public.isnle(upc, upc) OWNER TO postgres;

--
-- TOC entry 1808 (class 1255 OID 85749)
-- Dependencies: 2823 2823 11
-- Name: isnlt(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1809 (class 1255 OID 85750)
-- Dependencies: 2863 2823 11
-- Name: isnlt(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1810 (class 1255 OID 85751)
-- Dependencies: 2867 2823 11
-- Name: isnlt(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1811 (class 1255 OID 85752)
-- Dependencies: 2884 2823 11
-- Name: isnlt(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1812 (class 1255 OID 85753)
-- Dependencies: 2890 2823 11
-- Name: isnlt(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1813 (class 1255 OID 85754)
-- Dependencies: 2894 2823 11
-- Name: isnlt(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1814 (class 1255 OID 85755)
-- Dependencies: 2900 2823 11
-- Name: isnlt(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1815 (class 1255 OID 85756)
-- Dependencies: 2932 2823 11
-- Name: isnlt(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1816 (class 1255 OID 85757)
-- Dependencies: 2823 2863 11
-- Name: isnlt(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1817 (class 1255 OID 85758)
-- Dependencies: 2863 2863 11
-- Name: isnlt(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1818 (class 1255 OID 85759)
-- Dependencies: 2867 2863 11
-- Name: isnlt(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1819 (class 1255 OID 85760)
-- Dependencies: 2823 2867 11
-- Name: isnlt(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1820 (class 1255 OID 85761)
-- Dependencies: 2863 2867 11
-- Name: isnlt(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1821 (class 1255 OID 85762)
-- Dependencies: 2867 2867 11
-- Name: isnlt(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1822 (class 1255 OID 85763)
-- Dependencies: 2823 2884 11
-- Name: isnlt(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1823 (class 1255 OID 85764)
-- Dependencies: 2884 2884 11
-- Name: isnlt(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1824 (class 1255 OID 85765)
-- Dependencies: 2890 2884 11
-- Name: isnlt(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1825 (class 1255 OID 85766)
-- Dependencies: 2823 2890 11
-- Name: isnlt(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1826 (class 1255 OID 85767)
-- Dependencies: 2884 2890 11
-- Name: isnlt(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1827 (class 1255 OID 85770)
-- Dependencies: 2890 2890 11
-- Name: isnlt(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1828 (class 1255 OID 85771)
-- Dependencies: 2823 2894 11
-- Name: isnlt(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1829 (class 1255 OID 85772)
-- Dependencies: 2894 2894 11
-- Name: isnlt(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn, issn) OWNER TO postgres;

--
-- TOC entry 1830 (class 1255 OID 85773)
-- Dependencies: 2900 2894 11
-- Name: isnlt(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1831 (class 1255 OID 85774)
-- Dependencies: 2823 2900 11
-- Name: isnlt(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1832 (class 1255 OID 85775)
-- Dependencies: 2894 2900 11
-- Name: isnlt(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1833 (class 1255 OID 85776)
-- Dependencies: 2900 2900 11
-- Name: isnlt(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1834 (class 1255 OID 85777)
-- Dependencies: 2823 2932 11
-- Name: isnlt(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1835 (class 1255 OID 85778)
-- Dependencies: 2932 2932 11
-- Name: isnlt(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnlt(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8lt$$;


ALTER FUNCTION public.isnlt(upc, upc) OWNER TO postgres;

--
-- TOC entry 1836 (class 1255 OID 85779)
-- Dependencies: 2823 2823 11
-- Name: isnne(ean13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, ean13) OWNER TO postgres;

--
-- TOC entry 1837 (class 1255 OID 85780)
-- Dependencies: 2863 2823 11
-- Name: isnne(ean13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, isbn) OWNER TO postgres;

--
-- TOC entry 1838 (class 1255 OID 85781)
-- Dependencies: 2867 2823 11
-- Name: isnne(ean13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 1839 (class 1255 OID 85782)
-- Dependencies: 2884 2823 11
-- Name: isnne(ean13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, ismn) OWNER TO postgres;

--
-- TOC entry 1840 (class 1255 OID 85783)
-- Dependencies: 2890 2823 11
-- Name: isnne(ean13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 1841 (class 1255 OID 85784)
-- Dependencies: 2894 2823 11
-- Name: isnne(ean13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, issn) OWNER TO postgres;

--
-- TOC entry 1842 (class 1255 OID 85785)
-- Dependencies: 2900 2823 11
-- Name: isnne(ean13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, issn13) OWNER TO postgres;

--
-- TOC entry 1843 (class 1255 OID 85786)
-- Dependencies: 2932 2823 11
-- Name: isnne(ean13, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ean13, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ean13, upc) OWNER TO postgres;

--
-- TOC entry 1844 (class 1255 OID 85787)
-- Dependencies: 2823 2863 11
-- Name: isnne(isbn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn, ean13) OWNER TO postgres;

--
-- TOC entry 1845 (class 1255 OID 85788)
-- Dependencies: 2863 2863 11
-- Name: isnne(isbn, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn, isbn) OWNER TO postgres;

--
-- TOC entry 1846 (class 1255 OID 85789)
-- Dependencies: 2867 2863 11
-- Name: isnne(isbn, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 1847 (class 1255 OID 85790)
-- Dependencies: 2823 2867 11
-- Name: isnne(isbn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 1848 (class 1255 OID 85791)
-- Dependencies: 2863 2867 11
-- Name: isnne(isbn13, isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn13, isbn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 1849 (class 1255 OID 85792)
-- Dependencies: 2867 2867 11
-- Name: isnne(isbn13, isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(isbn13, isbn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 1850 (class 1255 OID 85793)
-- Dependencies: 2823 2884 11
-- Name: isnne(ismn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn, ean13) OWNER TO postgres;

--
-- TOC entry 1851 (class 1255 OID 85794)
-- Dependencies: 2884 2884 11
-- Name: isnne(ismn, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn, ismn) OWNER TO postgres;

--
-- TOC entry 1852 (class 1255 OID 85795)
-- Dependencies: 2890 2884 11
-- Name: isnne(ismn, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 1853 (class 1255 OID 85796)
-- Dependencies: 2823 2890 11
-- Name: isnne(ismn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 1854 (class 1255 OID 85797)
-- Dependencies: 2884 2890 11
-- Name: isnne(ismn13, ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn13, ismn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 1855 (class 1255 OID 85798)
-- Dependencies: 2890 2890 11
-- Name: isnne(ismn13, ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(ismn13, ismn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 1856 (class 1255 OID 85799)
-- Dependencies: 2823 2894 11
-- Name: isnne(issn, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn, ean13) OWNER TO postgres;

--
-- TOC entry 1857 (class 1255 OID 85800)
-- Dependencies: 2894 2894 11
-- Name: isnne(issn, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn, issn) OWNER TO postgres;

--
-- TOC entry 1858 (class 1255 OID 85801)
-- Dependencies: 2900 2894 11
-- Name: isnne(issn, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn, issn13) OWNER TO postgres;

--
-- TOC entry 1859 (class 1255 OID 85802)
-- Dependencies: 2823 2900 11
-- Name: isnne(issn13, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn13, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn13, ean13) OWNER TO postgres;

--
-- TOC entry 1860 (class 1255 OID 85803)
-- Dependencies: 2894 2900 11
-- Name: isnne(issn13, issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn13, issn) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn13, issn) OWNER TO postgres;

--
-- TOC entry 1861 (class 1255 OID 85804)
-- Dependencies: 2900 2900 11
-- Name: isnne(issn13, issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(issn13, issn13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(issn13, issn13) OWNER TO postgres;

--
-- TOC entry 1862 (class 1255 OID 85805)
-- Dependencies: 2823 2932 11
-- Name: isnne(upc, ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(upc, ean13) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(upc, ean13) OWNER TO postgres;

--
-- TOC entry 1863 (class 1255 OID 85806)
-- Dependencies: 2932 2932 11
-- Name: isnne(upc, upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION isnne(upc, upc) RETURNS boolean
    LANGUAGE internal IMMUTABLE STRICT
    AS $$int8ne$$;


ALTER FUNCTION public.isnne(upc, upc) OWNER TO postgres;

--
-- TOC entry 1864 (class 1255 OID 85807)
-- Dependencies: 2823 2894 11
-- Name: issn(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION issn(ean13) RETURNS issn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'issn_cast_from_ean13';


ALTER FUNCTION public.issn(ean13) OWNER TO postgres;

--
-- TOC entry 1865 (class 1255 OID 85808)
-- Dependencies: 2823 2900 11
-- Name: issn13(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION issn13(ean13) RETURNS issn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'issn_cast_from_ean13';


ALTER FUNCTION public.issn13(ean13) OWNER TO postgres;

--
-- TOC entry 1866 (class 1255 OID 85809)
-- Dependencies: 4822 11
-- Name: jornadaaudiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION jornadaaudiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO jornadaaudiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO jornadaaudiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO jornadaaudiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO jornadaaudiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.jornadaaudiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 1867 (class 1255 OID 85810)
-- Dependencies: 2827 11
-- Name: latitude(earth); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION latitude(earth) RETURNS double precision
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT CASE WHEN cube_ll_coord($1, 3)/earth() < -1 THEN -90::float8 WHEN cube_ll_coord($1, 3)/earth() > 1 THEN 90::float8 ELSE degrees(asin(cube_ll_coord($1, 3)/earth())) END$_$;


ALTER FUNCTION public.latitude(earth) OWNER TO postgres;

--
-- TOC entry 1868 (class 1255 OID 85811)
-- Dependencies: 2888 2882 11
-- Name: lca(ltree[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree[]) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', '_lca';


ALTER FUNCTION public.lca(ltree[]) OWNER TO postgres;

--
-- TOC entry 1869 (class 1255 OID 85812)
-- Dependencies: 2882 2882 2882 11
-- Name: lca(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1870 (class 1255 OID 85813)
-- Dependencies: 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1871 (class 1255 OID 85814)
-- Dependencies: 2882 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1872 (class 1255 OID 85815)
-- Dependencies: 2882 2882 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1873 (class 1255 OID 85816)
-- Dependencies: 2882 2882 2882 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree, ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree, ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree, ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1874 (class 1255 OID 85817)
-- Dependencies: 2882 2882 2882 2882 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1875 (class 1255 OID 85818)
-- Dependencies: 2882 2882 2882 2882 2882 2882 2882 2882 2882 11
-- Name: lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lca';


ALTER FUNCTION public.lca(ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1876 (class 1255 OID 85819)
-- Dependencies: 11
-- Name: levenshtein(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION levenshtein(text, text) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'levenshtein';


ALTER FUNCTION public.levenshtein(text, text) OWNER TO postgres;

--
-- TOC entry 1877 (class 1255 OID 85820)
-- Dependencies: 2827 11
-- Name: ll_to_earth(double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ll_to_earth(double precision, double precision) RETURNS earth
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth$_$;


ALTER FUNCTION public.ll_to_earth(double precision, double precision) OWNER TO postgres;

--
-- TOC entry 1878 (class 1255 OID 85821)
-- Dependencies: 11
-- Name: lo_manage(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lo_manage() RETURNS trigger
    LANGUAGE c
    AS '$libdir/lo', 'lo_manage';


ALTER FUNCTION public.lo_manage() OWNER TO postgres;

--
-- TOC entry 1879 (class 1255 OID 85822)
-- Dependencies: 2904 11
-- Name: lo_oid(lo); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lo_oid(lo) RETURNS oid
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT $1::pg_catalog.oid$_$;


ALTER FUNCTION public.lo_oid(lo) OWNER TO postgres;

--
-- TOC entry 1880 (class 1255 OID 85823)
-- Dependencies: 2827 11
-- Name: longitude(earth); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION longitude(earth) RETURNS double precision
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT degrees(atan2(cube_ll_coord($1, 2), cube_ll_coord($1, 1)))$_$;


ALTER FUNCTION public.longitude(earth) OWNER TO postgres;

--
-- TOC entry 1881 (class 1255 OID 85824)
-- Dependencies: 2907 2882 11
-- Name: lt_q_regex(ltree, lquery[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lt_q_regex(ltree, lquery[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lt_q_regex';


ALTER FUNCTION public.lt_q_regex(ltree, lquery[]) OWNER TO postgres;

--
-- TOC entry 1882 (class 1255 OID 85825)
-- Dependencies: 2882 2907 11
-- Name: lt_q_rregex(lquery[], ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION lt_q_rregex(lquery[], ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'lt_q_rregex';


ALTER FUNCTION public.lt_q_rregex(lquery[], ltree) OWNER TO postgres;

--
-- TOC entry 1883 (class 1255 OID 85826)
-- Dependencies: 2905 2882 11
-- Name: ltq_regex(ltree, lquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltq_regex(ltree, lquery) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltq_regex';


ALTER FUNCTION public.ltq_regex(ltree, lquery) OWNER TO postgres;

--
-- TOC entry 1884 (class 1255 OID 85827)
-- Dependencies: 2882 2905 11
-- Name: ltq_rregex(lquery, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltq_rregex(lquery, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltq_rregex';


ALTER FUNCTION public.ltq_rregex(lquery, ltree) OWNER TO postgres;

--
-- TOC entry 1885 (class 1255 OID 85828)
-- Dependencies: 2882 11
-- Name: ltree2text(ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree2text(ltree) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree2text';


ALTER FUNCTION public.ltree2text(ltree) OWNER TO postgres;

--
-- TOC entry 1886 (class 1255 OID 85829)
-- Dependencies: 2882 2882 2882 11
-- Name: ltree_addltree(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_addltree(ltree, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_addltree';


ALTER FUNCTION public.ltree_addltree(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1887 (class 1255 OID 85830)
-- Dependencies: 2882 2882 11
-- Name: ltree_addtext(ltree, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_addtext(ltree, text) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_addtext';


ALTER FUNCTION public.ltree_addtext(ltree, text) OWNER TO postgres;

--
-- TOC entry 1888 (class 1255 OID 85831)
-- Dependencies: 2882 2882 11
-- Name: ltree_cmp(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_cmp(ltree, ltree) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_cmp';


ALTER FUNCTION public.ltree_cmp(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1889 (class 1255 OID 85832)
-- Dependencies: 11
-- Name: ltree_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_compress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_compress';


ALTER FUNCTION public.ltree_compress(internal) OWNER TO postgres;

--
-- TOC entry 1890 (class 1255 OID 85833)
-- Dependencies: 11
-- Name: ltree_consistent(internal, internal, smallint); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_consistent(internal, internal, smallint) RETURNS boolean
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_consistent';


ALTER FUNCTION public.ltree_consistent(internal, internal, smallint) OWNER TO postgres;

--
-- TOC entry 1891 (class 1255 OID 85834)
-- Dependencies: 11
-- Name: ltree_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_decompress(internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_decompress';


ALTER FUNCTION public.ltree_decompress(internal) OWNER TO postgres;

--
-- TOC entry 1892 (class 1255 OID 85835)
-- Dependencies: 2882 2882 11
-- Name: ltree_eq(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_eq(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_eq';


ALTER FUNCTION public.ltree_eq(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1893 (class 1255 OID 85836)
-- Dependencies: 2882 2882 11
-- Name: ltree_ge(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_ge(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_ge';


ALTER FUNCTION public.ltree_ge(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1894 (class 1255 OID 85837)
-- Dependencies: 2882 2882 11
-- Name: ltree_gt(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_gt(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_gt';


ALTER FUNCTION public.ltree_gt(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1895 (class 1255 OID 85838)
-- Dependencies: 2882 2882 11
-- Name: ltree_isparent(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_isparent(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_isparent';


ALTER FUNCTION public.ltree_isparent(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1896 (class 1255 OID 85839)
-- Dependencies: 2882 2882 11
-- Name: ltree_le(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_le(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_le';


ALTER FUNCTION public.ltree_le(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1897 (class 1255 OID 85840)
-- Dependencies: 2882 2882 11
-- Name: ltree_lt(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_lt(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_lt';


ALTER FUNCTION public.ltree_lt(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1898 (class 1255 OID 85841)
-- Dependencies: 2882 2882 11
-- Name: ltree_ne(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_ne(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_ne';


ALTER FUNCTION public.ltree_ne(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1899 (class 1255 OID 85842)
-- Dependencies: 11
-- Name: ltree_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_penalty(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_penalty';


ALTER FUNCTION public.ltree_penalty(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1900 (class 1255 OID 85843)
-- Dependencies: 11
-- Name: ltree_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_picksplit(internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_picksplit';


ALTER FUNCTION public.ltree_picksplit(internal, internal) OWNER TO postgres;

--
-- TOC entry 1901 (class 1255 OID 85844)
-- Dependencies: 2882 2882 11
-- Name: ltree_risparent(ltree, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_risparent(ltree, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_risparent';


ALTER FUNCTION public.ltree_risparent(ltree, ltree) OWNER TO postgres;

--
-- TOC entry 1902 (class 1255 OID 85845)
-- Dependencies: 11
-- Name: ltree_same(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_same(internal, internal, internal) RETURNS internal
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_same';


ALTER FUNCTION public.ltree_same(internal, internal, internal) OWNER TO postgres;

--
-- TOC entry 1903 (class 1255 OID 85846)
-- Dependencies: 2882 2882 11
-- Name: ltree_textadd(text, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_textadd(text, ltree) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltree_textadd';


ALTER FUNCTION public.ltree_textadd(text, ltree) OWNER TO postgres;

--
-- TOC entry 1904 (class 1255 OID 85847)
-- Dependencies: 11
-- Name: ltree_union(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltree_union(internal, internal) RETURNS integer
    LANGUAGE c IMMUTABLE
    AS '$libdir/ltree', 'ltree_union';


ALTER FUNCTION public.ltree_union(internal, internal) OWNER TO postgres;

--
-- TOC entry 1905 (class 1255 OID 85848)
-- Dependencies: 11
-- Name: ltreeparentsel(internal, oid, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltreeparentsel(internal, oid, internal, integer) RETURNS double precision
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltreeparentsel';


ALTER FUNCTION public.ltreeparentsel(internal, oid, internal, integer) OWNER TO postgres;

--
-- TOC entry 1906 (class 1255 OID 85849)
-- Dependencies: 2915 2882 11
-- Name: ltxtq_exec(ltree, ltxtquery); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltxtq_exec(ltree, ltxtquery) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltxtq_exec';


ALTER FUNCTION public.ltxtq_exec(ltree, ltxtquery) OWNER TO postgres;

--
-- TOC entry 1907 (class 1255 OID 85850)
-- Dependencies: 2882 2915 11
-- Name: ltxtq_rexec(ltxtquery, ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ltxtq_rexec(ltxtquery, ltree) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'ltxtq_rexec';


ALTER FUNCTION public.ltxtq_rexec(ltxtquery, ltree) OWNER TO postgres;

--
-- TOC entry 1908 (class 1255 OID 85851)
-- Dependencies: 4822 11
-- Name: magistrado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION magistrado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO magistrado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO magistrado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO magistrado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO magistrado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.magistrado_audit_fun() OWNER TO postgres;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 326 (class 1259 OID 85852)
-- Dependencies: 11
-- Name: magistrado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE magistrado (
    idmagistrado integer NOT NULL,
    numeroidentificacion character varying(12),
    primernombre character varying(20) NOT NULL,
    segundonombre character varying(20),
    primerapellido character varying(20) NOT NULL,
    segundoapellido character varying(20),
    usuario character varying(10)
);


ALTER TABLE public.magistrado OWNER TO postgres;

--
-- TOC entry 1909 (class 1255 OID 85855)
-- Dependencies: 2569 11
-- Name: magistradoname(magistrado); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION magistradoname(magistrado) RETURNS character varying
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$select trim(both '- ' from (trim(from(coalesce($1.primerapellido, '') || ' ' || coalesce($1.segundoapellido, ''))) || '- ' || trim(from(coalesce($1.primernombre, '') || ' ' || coalesce($1.segundonombre, '')))));$_$;


ALTER FUNCTION public.magistradoname(magistrado) OWNER TO postgres;

--
-- TOC entry 1910 (class 1255 OID 85856)
-- Dependencies: 2823 2823 11
-- Name: make_valid(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(ean13) RETURNS ean13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(ean13) OWNER TO postgres;

--
-- TOC entry 1911 (class 1255 OID 85857)
-- Dependencies: 2863 2863 11
-- Name: make_valid(isbn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(isbn) RETURNS isbn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(isbn) OWNER TO postgres;

--
-- TOC entry 1912 (class 1255 OID 85858)
-- Dependencies: 2867 2867 11
-- Name: make_valid(isbn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(isbn13) RETURNS isbn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(isbn13) OWNER TO postgres;

--
-- TOC entry 1913 (class 1255 OID 85859)
-- Dependencies: 2884 2884 11
-- Name: make_valid(ismn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(ismn) RETURNS ismn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(ismn) OWNER TO postgres;

--
-- TOC entry 1914 (class 1255 OID 85860)
-- Dependencies: 2890 2890 11
-- Name: make_valid(ismn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(ismn13) RETURNS ismn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(ismn13) OWNER TO postgres;

--
-- TOC entry 1915 (class 1255 OID 85861)
-- Dependencies: 2894 2894 11
-- Name: make_valid(issn); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(issn) RETURNS issn
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(issn) OWNER TO postgres;

--
-- TOC entry 1916 (class 1255 OID 85862)
-- Dependencies: 2900 2900 11
-- Name: make_valid(issn13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(issn13) RETURNS issn13
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(issn13) OWNER TO postgres;

--
-- TOC entry 1917 (class 1255 OID 85863)
-- Dependencies: 2932 2932 11
-- Name: make_valid(upc); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION make_valid(upc) RETURNS upc
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'make_valid';


ALTER FUNCTION public.make_valid(upc) OWNER TO postgres;

--
-- TOC entry 1918 (class 1255 OID 85864)
-- Dependencies: 4822 11
-- Name: mediopublicacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION mediopublicacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO mediopublicacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO mediopublicacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO mediopublicacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO mediopublicacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.mediopublicacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1920 (class 1255 OID 85865)
-- Dependencies: 4822 11
-- Name: menu_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION menu_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO menu_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO menu_audit SELECT 'U', now(), NEW.*;
            INSERT INTO menu_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO menu_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.menu_audit_fun() OWNER TO postgres;

--
-- TOC entry 8926 (class 0 OID 0)
-- Dependencies: 1920
-- Name: FUNCTION menu_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION menu_audit_fun() IS 'Tabla menu';


--
-- TOC entry 1921 (class 1255 OID 85866)
-- Dependencies: 11
-- Name: metaphone(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION metaphone(text, integer) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'metaphone';


ALTER FUNCTION public.metaphone(text, integer) OWNER TO postgres;

--
-- TOC entry 1922 (class 1255 OID 85867)
-- Dependencies: 11
-- Name: moddatetime(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION moddatetime() RETURNS trigger
    LANGUAGE c
    AS '$libdir/moddatetime', 'moddatetime';


ALTER FUNCTION public.moddatetime() OWNER TO postgres;

--
-- TOC entry 1923 (class 1255 OID 85868)
-- Dependencies: 4822 11
-- Name: modusoperandi_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION modusoperandi_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO modusoperandi_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO modusoperandi_audit SELECT 'U', now(), NEW.*;
            INSERT INTO modusoperandi_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO modusoperandi_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.modusoperandi_audit_fun() OWNER TO postgres;

--
-- TOC entry 8927 (class 0 OID 0)
-- Dependencies: 1923
-- Name: FUNCTION modusoperandi_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION modusoperandi_audit_fun() IS 'Tipos de modus operandi.';


--
-- TOC entry 1924 (class 1255 OID 85869)
-- Dependencies: 4822 11
-- Name: motivoterminacionetapapostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION motivoterminacionetapapostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO motivoterminacionetapapostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO motivoterminacionetapapostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO motivoterminacionetapapostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO motivoterminacionetapapostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.motivoterminacionetapapostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1925 (class 1255 OID 85870)
-- Dependencies: 4822 11
-- Name: movil_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION movil_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO movil_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO movil_audit SELECT 'U', now(), NEW.*;
            INSERT INTO movil_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO movil_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.movil_audit_fun() OWNER TO postgres;

--
-- TOC entry 8928 (class 0 OID 0)
-- Dependencies: 1925
-- Name: FUNCTION movil_audit_fun(); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION movil_audit_fun() IS 'Tipo de movil de un hecho.';


--
-- TOC entry 1926 (class 1255 OID 85871)
-- Dependencies: 2810 11
-- Name: ne(chkpass, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ne(chkpass, text) RETURNS boolean
    LANGUAGE c STRICT
    AS '$libdir/chkpass', 'chkpass_ne';


ALTER FUNCTION public.ne(chkpass, text) OWNER TO postgres;

--
-- TOC entry 1927 (class 1255 OID 85872)
-- Dependencies: 4822 11
-- Name: nivel_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION nivel_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO nivel_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO nivel_audit SELECT 'U', now(), NEW.*;
            INSERT INTO nivel_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO nivel_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.nivel_audit_fun() OWNER TO postgres;

--
-- TOC entry 1928 (class 1255 OID 85873)
-- Dependencies: 2882 11
-- Name: nlevel(ltree); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION nlevel(ltree) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'nlevel';


ALTER FUNCTION public.nlevel(ltree) OWNER TO postgres;

--
-- TOC entry 1929 (class 1255 OID 85874)
-- Dependencies: 11
-- Name: normal_rand(integer, double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION normal_rand(integer, double precision, double precision) RETURNS SETOF double precision
    LANGUAGE c STRICT
    AS '$libdir/tablefunc', 'normal_rand';


ALTER FUNCTION public.normal_rand(integer, double precision, double precision) OWNER TO postgres;

--
-- TOC entry 1930 (class 1255 OID 85875)
-- Dependencies: 4822 11
-- Name: notificacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION notificacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO notificacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO notificacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO notificacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO notificacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.notificacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1931 (class 1255 OID 85876)
-- Dependencies: 4822 11
-- Name: notificacioncorreo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION notificacioncorreo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO notificacioncorreo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO notificacioncorreo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO notificacioncorreo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO notificacioncorreo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.notificacioncorreo_audit_fun() OWNER TO postgres;

--
-- TOC entry 1932 (class 1255 OID 85877)
-- Dependencies: 4822 11
-- Name: obtener_magistrado(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION obtener_magistrado(integer) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE
      mag RECORD;
      magistrados text;
BEGIN
     magistrados:='';	
     FOR mag IN SELECT magistradoname(magistrado)AS magistrado FROM public.audiencia 
	LEFT  OUTER JOIN public.relacionmagistradoaudiencia ON (public.audiencia.idaudiencia = public.relacionmagistradoaudiencia.idaudiencia)
	LEFT  OUTER JOIN public.magistrado ON (public.relacionmagistradoaudiencia.idmagistrado = public.magistrado.idmagistrado)
WHERE
  public.audiencia.idaudiencia = $1
     LOOP
	magistrados:=magistrados || ',' || mag.magistrado;         
     END LOOP;
     RETURN substring(magistrados,2,length(magistrados));
END
$_$;


ALTER FUNCTION public.obtener_magistrado(integer) OWNER TO postgres;

--
-- TOC entry 1933 (class 1255 OID 85878)
-- Dependencies: 4822 11
-- Name: obtener_moduoperandi(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION obtener_moduoperandi(integer, integer) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE
      modus RECORD;
      desmodus text;
BEGIN
     desmodus:='';	
     FOR modus IN SELECT public.modusoperandi.descripcion as des FROM public.relacioneventomodusoperandi 
	INNER JOIN public.modusoperandi ON (public.relacioneventomodusoperandi.idmodusoperandi = public.modusoperandi.idmodusoperandi)
	INNER JOIN public.relacioncarpetahechoevento ON (public.relacioneventomodusoperandi.idevento = public.relacioncarpetahechoevento.idevento)
     WHERE
	public.relacioncarpetahechoevento.idcarpetahecho = $1 AND public.relacioncarpetahechoevento.idevento = $2
     LOOP
	desmodus:=desmodus || ',' || modus.des;         
     END LOOP;
     RETURN substring(desmodus,2,length(desmodus));
END
$_$;


ALTER FUNCTION public.obtener_moduoperandi(integer, integer) OWNER TO postgres;

--
-- TOC entry 1934 (class 1255 OID 85879)
-- Dependencies: 4822 11
-- Name: origenevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION origenevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO origenevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO origenevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO origenevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO origenevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.origenevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 1935 (class 1255 OID 85880)
-- Dependencies: 4822 11
-- Name: origenfuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION origenfuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO origenfuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO origenfuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO origenfuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO origenfuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.origenfuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1936 (class 1255 OID 85881)
-- Dependencies: 4822 11
-- Name: origenhechoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION origenhechoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO origenhechoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO origenhechoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO origenhechoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO origenhechoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.origenhechoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1937 (class 1255 OID 85882)
-- Dependencies: 11
-- Name: page_header(bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION page_header(page bytea, OUT lsn text, OUT tli smallint, OUT flags smallint, OUT lower smallint, OUT upper smallint, OUT special smallint, OUT pagesize smallint, OUT version smallint, OUT prune_xid xid) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pageinspect', 'page_header';


ALTER FUNCTION public.page_header(page bytea, OUT lsn text, OUT tli smallint, OUT flags smallint, OUT lower smallint, OUT upper smallint, OUT special smallint, OUT pagesize smallint, OUT version smallint, OUT prune_xid xid) OWNER TO postgres;

--
-- TOC entry 1938 (class 1255 OID 85883)
-- Dependencies: 4822 11
-- Name: partidos_politicos_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION partidos_politicos_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO partidos_politicos_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO partidos_politicos_audit SELECT 'U', now(), NEW.*;
            INSERT INTO partidos_politicos_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO partidos_politicos_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.partidos_politicos_audit_fun() OWNER TO postgres;

--
-- TOC entry 1939 (class 1255 OID 85884)
-- Dependencies: 4822 11
-- Name: persona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION persona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO persona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO persona_audit SELECT 'U', now(),  NEW.*;
            INSERT INTO persona_audit SELECT 'X', now(),  OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO persona_audit SELECT 'I', now(),  NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.persona_audit_fun() OWNER TO postgres;

--
-- TOC entry 1940 (class 1255 OID 85885)
-- Dependencies: 4822 11
-- Name: personacambiodeidentidad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personacambiodeidentidad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO personacambiodeidentidad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO personacambiodeidentidad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO personacambiodeidentidad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO personacambiodeidentidad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.personacambiodeidentidad_audit_fun() OWNER TO postgres;

--
-- TOC entry 1941 (class 1255 OID 85886)
-- Dependencies: 4822 11
-- Name: personaestadohistorico_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personaestadohistorico_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO personaestadohistorico_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO personaestadohistorico_audit SELECT 'U', now(), NEW.*;
            INSERT INTO personaestadohistorico_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO personaestadohistorico_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.personaestadohistorico_audit_fun() OWNER TO postgres;

--
-- TOC entry 1943 (class 1255 OID 85887)
-- Dependencies: 4822 11
-- Name: personaestadosocioeconomico_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personaestadosocioeconomico_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO personaestadosocioeconomico_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO personaestadosocioeconomico_audit SELECT 'U', now(), NEW.*;
            INSERT INTO personaestadosocioeconomico_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO personaestadosocioeconomico_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.personaestadosocioeconomico_audit_fun() OWNER TO postgres;

--
-- TOC entry 1944 (class 1255 OID 85888)
-- Dependencies: 4822 11
-- Name: personajuridicacolectividad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personajuridicacolectividad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO personajuridicacolectividad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO personajuridicacolectividad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO personajuridicacolectividad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO personajuridicacolectividad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.personajuridicacolectividad_audit_fun() OWNER TO postgres;

--
-- TOC entry 1945 (class 1255 OID 85889)
-- Dependencies: 4822 11
-- Name: personajuridicacolectividadcorreo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personajuridicacolectividadcorreo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO personajuridicacolectividadcorreo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO personajuridicacolectividadcorreo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO personajuridicacolectividadcorreo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO personajuridicacolectividadcorreo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.personajuridicacolectividadcorreo_audit_fun() OWNER TO postgres;

--
-- TOC entry 327 (class 1259 OID 85890)
-- Dependencies: 11
-- Name: persona_idpersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE persona_idpersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.persona_idpersona_seq OWNER TO postgres;

--
-- TOC entry 328 (class 1259 OID 85892)
-- Dependencies: 7230 7231 11
-- Name: persona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE persona (
    numeroidentificacion character varying(12),
    primernombre character varying(20) NOT NULL,
    segundonombre character varying(20),
    primerapellido character varying(20) NOT NULL,
    segundoapellido character varying(20),
    alias character varying(200),
    direccion character varying(200),
    telefono character varying(40),
    mail character varying(40),
    vereda character varying(100),
    corregimiento character varying(100),
    fechanacimiento date,
    idpersona integer DEFAULT nextval('persona_idpersona_seq'::regclass) NOT NULL,
    fechaexpedicion date,
    idtipopersona integer NOT NULL,
    iddocumentodeidentidad integer,
    idpaisdocumentodeidentidad integer,
    idmunicipiodocumentodeidentidad integer,
    idpaisdenacimiento integer,
    idmunicipionacimiento integer,
    idestadocivil integer,
    idniveleducacion integer,
    idprofesion integer,
    iddepartamentodocumentodeidentidad integer,
    idfuenteinformacion integer,
    iddepartamentonacimineto integer,
    idgruposanguineo integer,
    idpaisdireccion integer,
    iddepartamentodireccion integer,
    idmunicipiodireccion integer,
    estado character varying(60) NOT NULL,
    foto integer,
    idgenero character varying(1),
    oficio character varying(200),
    inspecciondireccion character varying(100),
    barriodireccion character varying(100),
    fincadireccion character varying(100),
    usuario character varying(10),
    idraza integer,
    idreligion integer,
    idpartido_politico integer,
    ididentificacion integer,
    idgrupos_etnicos integer,
    idtendenciasexual integer,
    permisosms boolean DEFAULT false NOT NULL,
    ip character varying(15),
    observacion character varying(250),
    idtipodiscapacidad integer,
    movil character varying(35),
    sitiodireccion character varying(200),
    idtipoclasificacionpersonajuridica integer,
    idtiposubclasificacionpersonajuridica integer
);


ALTER TABLE public.persona OWNER TO postgres;

--
-- TOC entry 8929 (class 0 OID 0)
-- Dependencies: 328
-- Name: TABLE persona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE persona IS 'Datos de la persona';


--
-- TOC entry 8930 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.numeroidentificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.numeroidentificacion IS 'Numero de identificacion';


--
-- TOC entry 8931 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.primernombre IS 'Primer nombre de la persona';


--
-- TOC entry 8932 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.segundonombre IS 'Segundo nombre de la persona';


--
-- TOC entry 8933 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.primerapellido IS 'Primer apellido de la persona';


--
-- TOC entry 8934 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.segundoapellido IS 'Segundo apellido de la persona';


--
-- TOC entry 8935 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.alias; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.alias IS 'Alias con el que es conocido la persona';


--
-- TOC entry 8936 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.direccion IS 'Direccion de residencia de la persona';


--
-- TOC entry 8937 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.telefono; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.telefono IS 'Telefono de la residencia de la persona';


--
-- TOC entry 8938 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.mail; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.mail IS 'Correo electronico de la persona';


--
-- TOC entry 8939 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.vereda IS 'Vereda donde habita la persona';


--
-- TOC entry 8940 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.corregimiento IS 'Corregimiento donde habita la persona';


--
-- TOC entry 8941 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.fechanacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.fechanacimiento IS 'Fecha de nacimiento de la persona';


--
-- TOC entry 8942 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 8943 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.fechaexpedicion IS 'Fecha de expedicion de la cedula';


--
-- TOC entry 8944 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idtipopersona IS 'Identificador unico de la persona';


--
-- TOC entry 8945 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.iddocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.iddocumentodeidentidad IS 'Identificador unico del tipo de documento de identidad';


--
-- TOC entry 8946 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idpaisdocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idpaisdocumentodeidentidad IS 'Identificador unico del pais de expedicion del documento de identidad';


--
-- TOC entry 8947 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idmunicipiodocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idmunicipiodocumentodeidentidad IS 'Identificador unico del municipio de expedicion del documento de identidad';


--
-- TOC entry 8948 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idpaisdenacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idpaisdenacimiento IS 'Identificador unico del pais de nacimiento de la persona';


--
-- TOC entry 8949 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idmunicipionacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idmunicipionacimiento IS 'Identificador unico del municipio de nacimiento de la persona';


--
-- TOC entry 8950 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idestadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idestadocivil IS 'Identificador unico del Estado civil de la persona';


--
-- TOC entry 8951 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idniveleducacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idniveleducacion IS 'Identificador unico del nivel de educacion de la persona';


--
-- TOC entry 8952 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idprofesion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idprofesion IS 'Identificador unico de la profesion de la persona';


--
-- TOC entry 8953 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.iddepartamentodocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.iddepartamentodocumentodeidentidad IS 'Identificador unico del departamento de expedicion del documento de identidad';


--
-- TOC entry 8954 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idfuenteinformacion IS 'Identificador unico de la fuente de informacion';


--
-- TOC entry 8955 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.iddepartamentonacimineto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.iddepartamentonacimineto IS 'Identificador unico del departamento de nacimiento de la persona';


--
-- TOC entry 8956 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idgruposanguineo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idgruposanguineo IS 'Identificador  unico del grupo sanguineo de la persona';


--
-- TOC entry 8957 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idpaisdireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idpaisdireccion IS 'Identificador unico de la direccion del pais de contacto de la persona';


--
-- TOC entry 8958 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.iddepartamentodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.iddepartamentodireccion IS 'Identificador unico del departamento de la direccion de la persona';


--
-- TOC entry 8959 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idmunicipiodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idmunicipiodireccion IS 'Identificador unico del municipio de la direccion de la persona';


--
-- TOC entry 8960 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.estado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.estado IS 'Estado actual de la persona vivo, muerto.. etc';


--
-- TOC entry 8961 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.foto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.foto IS 'Fotografia de la persona';


--
-- TOC entry 8962 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idgenero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idgenero IS 'Identificador unico del genero';


--
-- TOC entry 8963 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.oficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.oficio IS 'Oficio al cual se dedica la persona';


--
-- TOC entry 8964 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.inspecciondireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.inspecciondireccion IS 'Inspeccion (lugar) de direccion de domicilio de la persona';


--
-- TOC entry 8965 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.barriodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.barriodireccion IS 'Barrio en el cual se encuentra la direccion del domicilio de la persona';


--
-- TOC entry 8966 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.fincadireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.fincadireccion IS 'Finca en la cual se encuentra la direccion del domicilio de la persona';


--
-- TOC entry 8967 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 8968 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.ip IS 'Direccion ip de la ultima actualizacion.';


--
-- TOC entry 8969 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.observacion IS 'observacion sobre la persona';


--
-- TOC entry 8970 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idtipodiscapacidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idtipodiscapacidad IS 'Tipo de discapacidad';


--
-- TOC entry 8971 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.movil IS 'Movil de la persona.';


--
-- TOC entry 8972 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.sitiodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.sitiodireccion IS 'Sitio de direccion de la persona';


--
-- TOC entry 8973 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idtipoclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idtipoclasificacionpersonajuridica IS 'Tipo de discapacidad';


--
-- TOC entry 8974 (class 0 OID 0)
-- Dependencies: 328
-- Name: COLUMN persona.idtiposubclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona.idtiposubclasificacionpersonajuridica IS 'Tipo de discapacidad';


--
-- TOC entry 1946 (class 1255 OID 85900)
-- Dependencies: 2573 11
-- Name: personname(persona); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personname(persona) RETURNS character varying
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$select trim(both ', ' from (trim(from(coalesce($1.primerapellido, '') || ' ' || coalesce($1.segundoapellido, ''))) || ', ' || trim(from(coalesce($1.primernombre, '') || ' ' || coalesce($1.segundonombre, '')))));$_$;


ALTER FUNCTION public.personname(persona) OWNER TO postgres;

--
-- TOC entry 329 (class 1259 OID 85901)
-- Dependencies: 7232 7233 7234 11
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario (
    login character varying(10) NOT NULL,
    password character varying(100) NOT NULL,
    primernombre character varying(20) NOT NULL,
    segundonombre character varying(20) NOT NULL,
    primerapellido character varying(20) NOT NULL,
    segundoapellido character varying(20) NOT NULL,
    idperfil integer NOT NULL,
    idcargo integer NOT NULL,
    rol character varying(20) NOT NULL,
    usuario character varying(10),
    idprocedenciausuario bigint,
    cedula character varying(50),
    codigo character varying(50),
    idmunicipiolabor integer,
    correo character varying(100),
    fechaultimoingreso timestamp without time zone DEFAULT now() NOT NULL,
    fechaultimocambioclave timestamp without time zone DEFAULT now() NOT NULL,
    cambiaclave boolean DEFAULT false
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 8975 (class 0 OID 0)
-- Dependencies: 329
-- Name: TABLE usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE usuario IS 'Usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8976 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.login; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.login IS 'Identificacion del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8977 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.password; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.password IS 'Contrasena del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8978 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.primernombre IS 'Primer nombre del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8979 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.segundonombre IS 'Segundo nombre del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8980 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.primerapellido IS 'Primer apellido del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8981 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.segundoapellido IS 'Segundo apellido del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8982 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.idperfil IS 'Identificador unico del perfil del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8983 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.idcargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.idcargo IS 'Identificador unico del cargo del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8984 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.rol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.rol IS 'Rol del usuario del Sistema de Informacion Justicia y Paz, que puede ser inactivo o sijyp';


--
-- TOC entry 8985 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.usuario IS 'Creador del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8986 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.idprocedenciausuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.idprocedenciausuario IS 'Identificador unico de la procedencia del creador de usuario';


--
-- TOC entry 8987 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.cedula; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.cedula IS 'Numero de cedula del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8988 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.codigo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.codigo IS 'Codigo del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8989 (class 0 OID 0)
-- Dependencies: 329
-- Name: COLUMN usuario.idmunicipiolabor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.idmunicipiolabor IS 'Identificador unico del municipio donde labora el usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 1947 (class 1255 OID 85907)
-- Dependencies: 2577 11
-- Name: personname(usuario); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personname(usuario) RETURNS character varying
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$select trim(both ', ' from (trim(from(coalesce($1.primerapellido, '') || ' ' || coalesce($1.segundoapellido, ''))) || ', ' || trim(from(coalesce($1.primernombre, '') || ' ' || coalesce($1.segundonombre, '')))));$_$;


ALTER FUNCTION public.personname(usuario) OWNER TO postgres;

--
-- TOC entry 1948 (class 1255 OID 85908)
-- Dependencies: 11
-- Name: personname(character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION personname(character varying, character varying, character varying, character varying) RETURNS character varying
    LANGUAGE sql IMMUTABLE
    AS $_$select trim(both ', ' from (trim(from(coalesce($1, '') || ' ' || coalesce($2, ''))) || ', ' || trim(from(coalesce($3, '') || ' ' || coalesce($4, '')))));$_$;


ALTER FUNCTION public.personname(character varying, character varying, character varying, character varying) OWNER TO postgres;

--
-- TOC entry 1949 (class 1255 OID 85909)
-- Dependencies: 11
-- Name: pg_buffercache_pages(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pg_buffercache_pages() RETURNS SETOF record
    LANGUAGE c
    AS '$libdir/pg_buffercache', 'pg_buffercache_pages';


ALTER FUNCTION public.pg_buffercache_pages() OWNER TO postgres;

--
-- TOC entry 1950 (class 1255 OID 85910)
-- Dependencies: 11
-- Name: pg_relpages(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pg_relpages(text) RETURNS integer
    LANGUAGE c STRICT
    AS '$libdir/pgstattuple', 'pg_relpages';


ALTER FUNCTION public.pg_relpages(text) OWNER TO postgres;

--
-- TOC entry 1951 (class 1255 OID 85911)
-- Dependencies: 11
-- Name: pgp_key_id(bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_key_id(bytea) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_key_id_w';


ALTER FUNCTION public.pgp_key_id(bytea) OWNER TO postgres;

--
-- TOC entry 1952 (class 1255 OID 85912)
-- Dependencies: 11
-- Name: pgp_pub_decrypt(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt(bytea, bytea) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text';


ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea) OWNER TO postgres;

--
-- TOC entry 1953 (class 1255 OID 85913)
-- Dependencies: 11
-- Name: pgp_pub_decrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text';


ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1954 (class 1255 OID 85914)
-- Dependencies: 11
-- Name: pgp_pub_decrypt(bytea, bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text';


ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea, text, text) OWNER TO postgres;

--
-- TOC entry 1955 (class 1255 OID 85915)
-- Dependencies: 11
-- Name: pgp_pub_decrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea';


ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea) OWNER TO postgres;

--
-- TOC entry 1956 (class 1255 OID 85916)
-- Dependencies: 11
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea';


ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1957 (class 1255 OID 85917)
-- Dependencies: 11
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea';


ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text, text) OWNER TO postgres;

--
-- TOC entry 1958 (class 1255 OID 85918)
-- Dependencies: 11
-- Name: pgp_pub_encrypt(text, bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_encrypt(text, bytea) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text';


ALTER FUNCTION public.pgp_pub_encrypt(text, bytea) OWNER TO postgres;

--
-- TOC entry 1959 (class 1255 OID 85919)
-- Dependencies: 11
-- Name: pgp_pub_encrypt(text, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_encrypt(text, bytea, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text';


ALTER FUNCTION public.pgp_pub_encrypt(text, bytea, text) OWNER TO postgres;

--
-- TOC entry 1960 (class 1255 OID 85920)
-- Dependencies: 11
-- Name: pgp_pub_encrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea';


ALTER FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea) OWNER TO postgres;

--
-- TOC entry 1961 (class 1255 OID 85921)
-- Dependencies: 11
-- Name: pgp_pub_encrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea';


ALTER FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea, text) OWNER TO postgres;

--
-- TOC entry 1962 (class 1255 OID 85922)
-- Dependencies: 11
-- Name: pgp_sym_decrypt(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_decrypt(bytea, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text';


ALTER FUNCTION public.pgp_sym_decrypt(bytea, text) OWNER TO postgres;

--
-- TOC entry 1963 (class 1255 OID 85923)
-- Dependencies: 11
-- Name: pgp_sym_decrypt(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_decrypt(bytea, text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text';


ALTER FUNCTION public.pgp_sym_decrypt(bytea, text, text) OWNER TO postgres;

--
-- TOC entry 1964 (class 1255 OID 85924)
-- Dependencies: 11
-- Name: pgp_sym_decrypt_bytea(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea';


ALTER FUNCTION public.pgp_sym_decrypt_bytea(bytea, text) OWNER TO postgres;

--
-- TOC entry 1965 (class 1255 OID 85925)
-- Dependencies: 11
-- Name: pgp_sym_decrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) RETURNS bytea
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea';


ALTER FUNCTION public.pgp_sym_decrypt_bytea(bytea, text, text) OWNER TO postgres;

--
-- TOC entry 1966 (class 1255 OID 85926)
-- Dependencies: 11
-- Name: pgp_sym_encrypt(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_encrypt(text, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text';


ALTER FUNCTION public.pgp_sym_encrypt(text, text) OWNER TO postgres;

--
-- TOC entry 1967 (class 1255 OID 85927)
-- Dependencies: 11
-- Name: pgp_sym_encrypt(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_encrypt(text, text, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text';


ALTER FUNCTION public.pgp_sym_encrypt(text, text, text) OWNER TO postgres;

--
-- TOC entry 1968 (class 1255 OID 85928)
-- Dependencies: 11
-- Name: pgp_sym_encrypt_bytea(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea';


ALTER FUNCTION public.pgp_sym_encrypt_bytea(bytea, text) OWNER TO postgres;

--
-- TOC entry 1919 (class 1255 OID 85929)
-- Dependencies: 11
-- Name: pgp_sym_encrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) RETURNS bytea
    LANGUAGE c STRICT
    AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea';


ALTER FUNCTION public.pgp_sym_encrypt_bytea(bytea, text, text) OWNER TO postgres;

--
-- TOC entry 1942 (class 1255 OID 85930)
-- Dependencies: 11
-- Name: pgstatindex(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgstatindex(relname text, OUT version integer, OUT tree_level integer, OUT index_size integer, OUT root_block_no integer, OUT internal_pages integer, OUT leaf_pages integer, OUT empty_pages integer, OUT deleted_pages integer, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pgstattuple', 'pgstatindex';


ALTER FUNCTION public.pgstatindex(relname text, OUT version integer, OUT tree_level integer, OUT index_size integer, OUT root_block_no integer, OUT internal_pages integer, OUT leaf_pages integer, OUT empty_pages integer, OUT deleted_pages integer, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision) OWNER TO postgres;

--
-- TOC entry 1969 (class 1255 OID 85931)
-- Dependencies: 11
-- Name: pgstattuple(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgstattuple(relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pgstattuple', 'pgstattuple';


ALTER FUNCTION public.pgstattuple(relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision) OWNER TO postgres;

--
-- TOC entry 1970 (class 1255 OID 85932)
-- Dependencies: 11
-- Name: pgstattuple(oid); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pgstattuple(reloid oid, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision) RETURNS record
    LANGUAGE c STRICT
    AS '$libdir/pgstattuple', 'pgstattuplebyid';


ALTER FUNCTION public.pgstattuple(reloid oid, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision) OWNER TO postgres;

--
-- TOC entry 1971 (class 1255 OID 85933)
-- Dependencies: 4822 11
-- Name: postulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION postulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO postulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO postulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO postulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO postulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.postulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1972 (class 1255 OID 85934)
-- Dependencies: 4822 11
-- Name: postuladoasignacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION postuladoasignacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO postuladoasignacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO postuladoasignacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO postuladoasignacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO postuladoasignacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.postuladoasignacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 1973 (class 1255 OID 85935)
-- Dependencies: 4822 11
-- Name: postuladoeventoaudiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION postuladoeventoaudiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO postuladoeventoaudiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO postuladoeventoaudiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO postuladoeventoaudiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO postuladoeventoaudiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.postuladoeventoaudiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 1974 (class 1255 OID 85936)
-- Dependencies: 11
-- Name: postuladoterminacionprocesodecisionposiblemodificar(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION postuladoterminacionprocesodecisionposiblemodificar(integer) RETURNS boolean
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$
-- VERSION: 1.0
-- AUTORS: JIMMY ALEXANDER CRUZ QUINTERO
-- FGN - UNJYP
-- 2011-01-17
-- BOGOTA - COLOMBIA

-- 1: ID DECISION TERMINACION PROCESO
SELECT 
  CASE
	WHEN count(*) > 0 THEN false
	ELSE true
  end
FROM
  public.decisionterminacionprocesopostulado decisionterminacionprocesopostulado1
  INNER JOIN public.decisionterminacionprocesopostulado ON (public.decisionterminacionprocesopostulado.idsolicitudterminacion = decisionterminacionprocesopostulado1.idsolicitudterminacion)
WHERE
  public.decisionterminacionprocesopostulado.iddecisionterminacion = $1 AND 
  public.decisionterminacionprocesopostulado.fechadecision < decisionterminacionprocesopostulado1.fechadecision;

$_$;


ALTER FUNCTION public.postuladoterminacionprocesodecisionposiblemodificar(integer) OWNER TO postgres;

--
-- TOC entry 1975 (class 1255 OID 85937)
-- Dependencies: 11
-- Name: postuladoterminacionprocesodecisionrecursos(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION postuladoterminacionprocesodecisionrecursos(integer) RETURNS character varying
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$
-- VERSION: 1.0
-- AUTORS: JIMMY ALEXANDER CRUZ QUINTERO
-- FGN - UNJYP
-- 2011-01-17
-- BOGOTA - COLOMBIA

-- 1: ID DECISION TERMINACION PROCESO
SELECT
	CASE
		WHEN rep AND ape THEN 'REPOSICION, APELACION'
		WHEN rep THEN 'REPOSICION'
		WHEN ape THEN 'APELACION'
		ELSE ''
	END
FROM
(SELECT
	CASE
		WHEN count(*)>0 THEN true
		ELSE false
	END AS rep
FROM
	public.reposicionterminacionprocesopostulado
WHERE
	iddecisionterminacion = $1) AS reposicion,
(SELECT
	CASE
		WHEN count(*)>0 THEN true
		ELSE false
	END AS ape
FROM
	public.apelacionterminacionprocesopostulado
WHERE
	iddecisionterminacion = $1) AS apelacion;

$_$;


ALTER FUNCTION public.postuladoterminacionprocesodecisionrecursos(integer) OWNER TO postgres;

--
-- TOC entry 1976 (class 1255 OID 85938)
-- Dependencies: 4822 11
-- Name: programacionreporte_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION programacionreporte_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO programacionreporte_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO programacionreporte_audit SELECT 'U', now(), NEW.*;
            INSERT INTO programacionreporte_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO programacionreporte_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.programacionreporte_audit_fun() OWNER TO postgres;

--
-- TOC entry 1977 (class 1255 OID 85939)
-- Dependencies: 4822 11
-- Name: publicacionexterna_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION publicacionexterna_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO publicacionexterna_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO publicacionexterna_audit SELECT 'U', now(), NEW.*;
            INSERT INTO publicacionexterna_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO publicacionexterna_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.publicacionexterna_audit_fun() OWNER TO postgres;

--
-- TOC entry 1978 (class 1255 OID 85940)
-- Dependencies: 4822 11
-- Name: publicacioninterna_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION publicacioninterna_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO publicacioninterna_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO publicacioninterna_audit SELECT 'U', now(), NEW.*;
            INSERT INTO publicacioninterna_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO publicacioninterna_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.publicacioninterna_audit_fun() OWNER TO postgres;

--
-- TOC entry 1979 (class 1255 OID 85941)
-- Dependencies: 11
-- Name: puede_ver_hecho(integer, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION puede_ver_hecho(integer, character varying) RETURNS boolean
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$
SELECT
            fiscal.fiscal or perfil.perfil or  fecha.fecha  or (evento.evento and Hecho.Hecho and reclutamiento.ilicito)
            FROM
            (SELECT
             CASE
               WHEN count(*) > 0 THEN TRUE
               ELSE FALSE
             END AS fiscal          
        FROM
          public.relacioncarpetahechoevento
          INNER JOIN public.evento ON (public.relacioncarpetahechoevento.idevento = public.evento.idevento)
          INNER JOIN public.carpetahecho ON (public.relacioncarpetahechoevento.idcarpetahecho = public.carpetahecho.idcarpetahecho)
        WHERE       
          (public.relacioncarpetahechoevento.idevento = $1 AND
          public.carpetahecho.fiscal = $2)) AS fiscal,
            (
    SELECT
            CASE
               WHEN count(*) > 0 THEN TRUE
               ELSE FALSE
             END AS evento
            FROM
            public.evento
            WHERE
             (public.evento.delitoprincipal not in (251, 252, 253, 309, 310, 311, 312, 313, 314, 592, 600) 
            and public.evento.idevento=$1)) as evento,
    (SELECT
            CASE
               WHEN count(*) = 0 THEN TRUE
               ELSE FALSE
             END AS Hecho
            FROM
            public.hecho
        INNER JOIN public.evento ON (public.hecho.idevento = public.evento.idevento)
            WHERE
            public.hecho.iddelito  in (251, 252, 253, 309, 310, 311, 312, 313, 314, 592, 600) 
            and public.evento.idevento=$1) as Hecho,            
            (SELECT
            CASE
            WHEN count(*)>0 THEN TRUE
            ELSE FALSE
            END AS perfil
            FROM usuario
            WHERE
            login = $2 AND
            (idperfil = 4 OR idperfil = 16 )) AS perfil,                      
            (SELECT
             CASE
               WHEN cast(now() AS date) - max(evento.fecharegistrosistema)< 2 THEN TRUE
               ELSE FALSE
             END AS fecha             
            FROM
            public.relacioncarpetahechoevento
            INNER JOIN public.evento ON (public.relacioncarpetahechoevento.idevento = public.evento.idevento)
            INNER JOIN public.carpetahecho ON (public.relacioncarpetahechoevento.idcarpetahecho = public.carpetahecho.idcarpetahecho)
            WHERE
            public.relacioncarpetahechoevento.idevento = $1 ) AS fecha,
            (
		SELECT CASE WHEN count(*) = 0 THEN TRUE ELSE FALSE  END as ilicito
		FROM hecho h 
			INNER JOIN relacioneventofuenteinfo rf ON h.idevento = rf.idevento 
			INNER JOIN fuenteinformaciondatos f ON rf.idfuenteinformacion = f.idfuenteinformacion 
		WHERE h.idevento = $1 AND h.iddelito =  274 AND f.idorigenfuenteinformacion=430) as reclutamiento;

$_$;


ALTER FUNCTION public.puede_ver_hecho(integer, character varying) OWNER TO postgres;

--
-- TOC entry 1980 (class 1255 OID 85942)
-- Dependencies: 11
-- Name: puede_ver_persona(character varying, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION puede_ver_persona(character varying, integer) RETURNS boolean
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$

SELECT
                fiscal.fiscal or perfil.perfil or  fecha.fechanovictima OR fecha.fechavictima or (evento.evento AND Hecho.Hecho AND reclutamiento.ilicito)
                FROM
                (SELECT
                 CASE
                   WHEN count(*) > 0 THEN TRUE
                   ELSE FALSE
                 END AS fiscal
                 FROM
                  public.relacioncarpetahechoevento
                  INNER JOIN public.evento ON (public.relacioncarpetahechoevento.idevento = public.evento.idevento)
                  INNER JOIN public.carpetahecho ON (public.relacioncarpetahechoevento.idcarpetahecho = public.carpetahecho.idcarpetahecho)
                  INNER JOIN public.hecho ON (public.hecho.idevento = public.evento.idevento)
                  INNER JOIN public.relacionvictimahecho ON (public.hecho.idhecho = public.relacionvictimahecho.idhecho)
                WHERE
                  public.relacionvictimahecho.idvictima = $2 AND
                  public.carpetahecho.fiscal = $1) AS fiscal,
                        (           
                SELECT
                        CASE
                           WHEN count(*) = 0 THEN TRUE
                           ELSE FALSE
                         END AS evento
                FROM
                  public.hecho
                  INNER JOIN public.evento ON (public.hecho.idevento = public.evento.idevento)
                  INNER JOIN public.relacionvictimahecho ON (public.hecho.idhecho = public.relacionvictimahecho.idhecho)
                    WHERE
                     (public.evento.delitoprincipal  in (251, 252, 253, 309, 310, 311, 312, 313, 314, 592, 600)
                    and  public.relacionvictimahecho.idvictima = $2)
                        ) as evento,           
                (SELECT
                        CASE
                           WHEN count(*) = 0 THEN TRUE
                           ELSE FALSE
                         END AS Hecho
                        FROM
                         public.hecho
                  INNER JOIN public.evento ON (public.hecho.idevento = public.evento.idevento)
                  INNER JOIN public.relacionvictimahecho ON (public.hecho.idhecho = public.relacionvictimahecho.idhecho)
                        WHERE
                        public.hecho.iddelito  in (251, 252, 253, 309, 310, 311, 312, 313, 314, 592, 600) 
                        and public.relacionvictimahecho.idvictima = $2) as Hecho, 
                                  
                        (SELECT
                        CASE
                        WHEN count(*)>0 THEN TRUE
                        ELSE FALSE
                        END AS perfil
                        FROM usuario
                        WHERE
                        login = $1 AND (
                        idperfil = 4 OR idperfil = 16 )) AS perfil,                            
                (SELECT
                 CASE
                   WHEN (cast(now() AS date) -  max(evento.fecharegistrosistema))  < 2 THEN true
                   ELSE false
                 END AS fechavictima,
                 CASE
                   WHEN count(*) = 0 THEN TRUE
                   ELSE FALSE
                 END AS fechanovictima
                FROM
                 public.relacionvictimahecho
                 INNER JOIN public.hecho ON (public.relacionvictimahecho.idhecho = public.hecho.idhecho)
                 INNER JOIN public.evento ON (public.hecho.idevento = public.evento.idevento)
                 INNER JOIN public.relacioncarpetahechoevento ON (public.relacioncarpetahechoevento.idevento = public.evento.idevento)
                 INNER JOIN public.carpetahecho ON (public.relacioncarpetahechoevento.idcarpetahecho = public.carpetahecho.idcarpetahecho)
                WHERE
                 public.relacionvictimahecho.idvictima = $2) AS fecha,                 
		(SELECT CASE WHEN count(*) = 0 THEN TRUE ELSE FALSE  END as ilicito
			FROM hecho h 
				INNER JOIN relacioneventofuenteinfo rf ON h.idevento = rf.idevento 
				INNER JOIN fuenteinformaciondatos f ON rf.idfuenteinformacion = f.idfuenteinformacion 
				INNER JOIN relacionvictimahecho rv ON rv.idhecho = h.idhecho
			WHERE rv.idvictima = $2 AND h.iddelito =  274 AND f.idorigenfuenteinformacion=430) as reclutamiento;


$_$;


ALTER FUNCTION public.puede_ver_persona(character varying, integer) OWNER TO postgres;

--
-- TOC entry 1981 (class 1255 OID 85943)
-- Dependencies: 2898 11
-- Name: querytree(query_int); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION querytree(query_int) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'querytree';


ALTER FUNCTION public.querytree(query_int) OWNER TO postgres;

--
-- TOC entry 1982 (class 1255 OID 85944)
-- Dependencies: 2810 11
-- Name: raw(chkpass); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION raw(chkpass) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/chkpass', 'chkpass_rout';


ALTER FUNCTION public.raw(chkpass) OWNER TO postgres;

--
-- TOC entry 1983 (class 1255 OID 85945)
-- Dependencies: 4822 11
-- Name: raza_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION raza_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO raza_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO raza_audit SELECT 'U', now(), NEW.*;
            INSERT INTO raza_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO raza_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.raza_audit_fun() OWNER TO postgres;

--
-- TOC entry 1984 (class 1255 OID 85946)
-- Dependencies: 2898 11
-- Name: rboolop(query_int, integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION rboolop(query_int, integer[]) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'rboolop';


ALTER FUNCTION public.rboolop(query_int, integer[]) OWNER TO postgres;

--
-- TOC entry 8990 (class 0 OID 0)
-- Dependencies: 1984
-- Name: FUNCTION rboolop(query_int, integer[]); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION rboolop(query_int, integer[]) IS 'boolean operation with array';


--
-- TOC entry 1985 (class 1255 OID 85947)
-- Dependencies: 4822 11
-- Name: reasignaciondesasignaciongrupoarmado(integer, text, integer, boolean, text, boolean, boolean, boolean); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION reasignaciondesasignaciongrupoarmado(integer, text, integer, boolean, text, boolean, boolean, boolean) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$

-- datos de entrada  idasignaciongrupoarmado, fiscalanterior, despachoanterior , estado ( si es true es reasignar y si es false es desasignar), usuario,cambiocarpeta,cambioregistros,cambio postulados
DECLARE
seejecuto boolean;
cons  record;
reg  record;
BEGIN
seejecuto:= false;

--Genero la consulta

FOR cons IN

SELECT  fiscal, despacho, idgrupoarmado, idestructura, idbloque, idfrente, public.resolucionasignacion.fecha as fecha
FROM    asignaciongrupoarmado INNER JOIN public.resolucionasignacion ON (asignaciongrupoarmado.idresolucionasignacion = public.resolucionasignacion.idresolucionasignacion)
WHERE idasignaciongrupoarmado = $1 AND estado

--Ingreso los datos
LOOP
if(cons.fiscal is not null) then

-- ACTUALIZO CARPETAS

if ($6)  then

	UPDATE carpetahecho SET   fiscal = cons.fiscal,  idautoridad = cons.despacho, usuario = $5  
	WHERE idcarpetahecho IN (SELECT  public.carpetahecho.idcarpetahecho 
			         FROM 
				public.carpetahecho
				INNER JOIN public.relacioncarpetahechoevento ON (public.carpetahecho.idcarpetahecho = public.relacioncarpetahechoevento.idcarpetahecho)
				INNER JOIN public.evento ON (public.relacioncarpetahechoevento.idevento = public.evento.idevento)
			        WHERE
				public.evento.idgrupoarmado = cons.idgrupoarmado AND
  				public.evento.idestructura = cons.idestructura AND 
  				public.evento.idbloque = cons.idbloque AND 
  				public.evento.idfrente = cons.idfrente AND
				public.carpetahecho.idautoridad = $3);
end if;

-- ACTUALIZO FORMATOS CON CONTROL REGISTRO HECHOS

if ($7)  then
	FOR reg IN
		SELECT controlregistrohechos.idregistrohecho
		FROM
			(SELECT controlregistrohechos.idregistrohecho, MAx(controlregistrohechos.conteo) as cont
			 FROM  controlregistrohechos INNER JOIN public.registrohecho ON 
				(controlregistrohechos.idregistrohecho = public.registrohecho.idregistrohecho) INNER JOIN public.evento ON (public.registrohecho.idevento = public.evento.idevento)
			 WHERE 
			 	public.evento.idgrupoarmado = cons.idgrupoarmado AND
  				public.evento.idestructura = cons.idestructura AND 
  				public.evento.idbloque = cons.idbloque AND 
  				public.evento.idfrente = cons.idfrente
  			GROUP BY controlregistrohechos.idregistrohecho) as T,controlregistrohechos
		WHERE 
		T.cont = controlregistrohechos.conteo AND
  		T.idregistrohecho = controlregistrohechos.idregistrohecho AND
  		controlregistrohechos.idautoridad = $3
	LOOP
		if(reg.idregistrohecho  is not null) then
			INSERT INTO controlregistrohechos(  idregistrohecho, idautoridad, fecha, observacion, usuarioreceptor, usuario, primernombre,segundonombre, primerapellido,segundoapellido,
						      	cargo, entidad)
			VALUES( reg.idregistrohecho, cons.despacho, NOW(), 'SE REMITE BAJO EL ACTA DE ASIGNACION NUMERO '  || cast($1 as text), cons.fiscal, $5, '', '', '', '', '','');

		end if;
	END LOOP;		
end if;
-- ACTUALIZO POSTULADOS
if ($8)  then


-- INGRESO EN LA TABLA historicopostuladoasignaciongrupoarmado

INSERT INTO public.historicopostuladoasignaciongrupoarmado( idasignaciongrupoarmado, radicado, fecha, usuario)
SELECT DISTINCT  $1,p.r, cast(cons.fecha as date), $5  from
(SELECT postuladoasignacion.radicado as r
FROM   postuladoasignacion 
             WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		 idbloque = cons.idbloque AND idfrente = cons.idfrente AND despacho = $3 
union all
SELECT postulado.radicado FROM  postulado  
				WHERE idgrupoarmado = cons.idgrupoarmado  AND idestructura = cons.idestructura  AND 
		                        idbloque = cons.idbloque AND idfrente = cons.idfrente AND despacho = $3  ) as p;


   -- TABLA postuladoasignacion 

	UPDATE  postuladoasignacion SET  fiscal = cons.fiscal, despacho = cons.despacho,  usuario = $5  
			WHERE 
			despacho = $3 AND 
			idgrupoarmado = cons.idgrupoarmado AND
  			idestructura = cons.idestructura AND 
  			idbloque = cons.idbloque AND 
  			idfrente = cons.idfrente;

  -- TABLA postulado

	UPDATE  postulado SET  fiscal = cons.fiscal, despacho = cons.despacho,  usuario = $5  
			WHERE 
			despacho = $3 AND 
			idgrupoarmado = cons.idgrupoarmado AND
  			idestructura = cons.idestructura AND 
  			idbloque = cons.idbloque AND 
  			idfrente = cons.idfrente;

end if;
-- ACTUALIZO EL ESTADO EN LA TABLA

UPDATE asignaciongrupoarmado SET estado = $4,  usuario = $5  WHERE  idasignaciongrupoarmado = $1;

seejecuto:= true;      
end if;

END LOOP;
   
RETURN seejecuto;

END
$_$;


ALTER FUNCTION public.reasignaciondesasignaciongrupoarmado(integer, text, integer, boolean, text, boolean, boolean, boolean) OWNER TO postgres;

--
-- TOC entry 1986 (class 1255 OID 85948)
-- Dependencies: 4822 11
-- Name: reasignacionpostulado(integer, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION reasignacionpostulado(integer, text, integer) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
-- idacta,usuario,despacho
DECLARE
seejecuto boolean;
cons record;
vali  record;
BEGIN
seejecuto:= FALSE;

--valido si en actarteasignacion ya existe el acta
FOR vali IN

SELECT COUNT(*) AS  T FROM public.actareasignacion WHERE idactaasignacion = $1
LOOP
if(vali.T = 0) then
--Genero la consulta
	FOR cons IN
		SELECT A.*,N.* FROM
		(SELECT
		  public.asignacionpostulados.idgrupoarmado as idgrupoarmadoA,
		  public.asignacionpostulados.idestructura as idestructuraA,
		  public.asignacionpostulados.idbloque as idbloqueA,
		  public.asignacionpostulados.idfrente as idfrenteA,
		Max(public.asignacionpostulados.fechaasignacion) as F
		FROM
		  public.acta_asignacion
		  INNER JOIN public.relacionpostuladoacta ON (public.acta_asignacion.idacta = public.relacionpostuladoacta.idacta)
		  INNER JOIN public.asignacionpostulados ON (public.relacionpostuladoacta.radicado = public.asignacionpostulados.radicado)
		WHERE
		  public.acta_asignacion.idacta = $1
		  group by  
		  public.asignacionpostulados.idgrupoarmado,
		  public.asignacionpostulados.idestructura,
		  public.asignacionpostulados.idbloque,
		  public.asignacionpostulados.idfrente
		  order by   f desc
		  limit 1) as A
		,(SELECT
		  public.postulado.despacho,
		  public.postulado.idgrupoarmado,
		  public.postulado.idestructura,
		  public.postulado.idbloque,
		  public.postulado.idfrente
		FROM
		  public.relacionpostuladoacta
		  INNER JOIN public.acta_asignacion ON (public.relacionpostuladoacta.idacta = public.acta_asignacion.idacta)
		  INNER JOIN public.postulado ON (public.relacionpostuladoacta.radicado = public.postulado.radicado)
		  AND (public.acta_asignacion.despacho = public.postulado.despacho)
		WHERE
		  public.postulado.reasignacion AND
		  public.relacionpostuladoacta.idacta = $1) as N
		limit 1
		--Ingreso los datos
		LOOP
		if(cons.idgrupoarmadoA is not null) then
		INSERT INTO
		  public.actareasignacion(idactaasignacion, idgrupoarmadoanterior, idestructuraanterior, idbloqueanterior, idfrenteanterior,
					  idgrupoarmadonuevo, idestructuranueva, idbloquenuevo, idfrentenuevo, soportereasignacion, despachoanterior,usuario)
		VALUES($1,cons.idgrupoarmadoA,cons.idestructuraA,cons.idbloqueA,cons.idfrenteA,cons.idgrupoarmado,cons.idestructura,cons.idbloque,cons.idfrente,
		       '',$3,$2);
	        seejecuto:= TRUE;
		end if;
	END LOOP;
ELSE
	seejecuto:= TRUE;
end if;
END LOOP;   

RETURN seejecuto;

END
$_$;


ALTER FUNCTION public.reasignacionpostulado(integer, text, integer) OWNER TO postgres;

--
-- TOC entry 1987 (class 1255 OID 85949)
-- Dependencies: 4822 11
-- Name: registrohecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION registrohecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO registrohecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO registrohecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO registrohecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO registrohecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.registrohecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 1988 (class 1255 OID 85950)
-- Dependencies: 4822 11
-- Name: relacionactuacionhistoricoprocesalpersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionactuacionhistoricoprocesalpersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionactuacionhistoricoprocesalpersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionactuacionhistoricoprocesalpersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionactuacionhistoricoprocesalpersona_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionactuacionhistoricoprocesalpersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionactuacionhistoricoprocesalpersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 1989 (class 1255 OID 85951)
-- Dependencies: 4822 11
-- Name: relacionalbumfotograficofoto_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionalbumfotograficofoto_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionalbumfotograficofoto_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionalbumfotograficofoto_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionalbumfotograficofoto_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionalbumfotograficofoto_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionalbumfotograficofoto_audit_fun() OWNER TO postgres;

--
-- TOC entry 1990 (class 1255 OID 85952)
-- Dependencies: 4822 11
-- Name: relacionaudienciacarpeta_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionaudienciacarpeta_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionaudienciacarpeta_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionaudienciacarpeta_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionaudienciacarpeta_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionaudienciacarpeta_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionaudienciacarpeta_audit_fun() OWNER TO postgres;

--
-- TOC entry 1991 (class 1255 OID 85953)
-- Dependencies: 4822 11
-- Name: relacionaudienciafiscal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionaudienciafiscal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionaudienciafiscal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionaudienciafiscal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionaudienciafiscal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionaudienciafiscal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionaudienciafiscal_audit_fun() OWNER TO postgres;

--
-- TOC entry 1992 (class 1255 OID 85954)
-- Dependencies: 4822 11
-- Name: relacionaudienciaradicado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionaudienciaradicado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionaudienciaradicado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionaudienciaradicado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionaudienciaradicado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionaudienciaradicado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionaudienciaradicado_audit_fun() OWNER TO postgres;

--
-- TOC entry 1993 (class 1255 OID 85955)
-- Dependencies: 4822 11
-- Name: relacionautorevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionautorevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionautorevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionautorevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionautorevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionautorevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionautorevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 1999 (class 1255 OID 85956)
-- Dependencies: 4822 11
-- Name: relacionautorhecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionautorhecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionautorhecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionautorhecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionautorhecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionautorhecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionautorhecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 2000 (class 1255 OID 85957)
-- Dependencies: 4822 11
-- Name: relacionbienhecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionbienhecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionbienhecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionbienhecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionbienhecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionbienhecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionbienhecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 2001 (class 1255 OID 85958)
-- Dependencies: 4822 11
-- Name: relacioncarpetahechoevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioncarpetahechoevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioncarpetahechoevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioncarpetahechoevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioncarpetahechoevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioncarpetahechoevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioncarpetahechoevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2002 (class 1255 OID 85959)
-- Dependencies: 4822 11
-- Name: relacioncausadecisionterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioncausadecisionterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioncausadecisionterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioncausadecisionterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioncausadecisionterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioncausadecisionterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioncausadecisionterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2003 (class 1255 OID 85960)
-- Dependencies: 4822 11
-- Name: relacioncausaterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioncausaterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioncausaterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioncausaterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioncausaterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioncausaterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioncausaterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2004 (class 1255 OID 85961)
-- Dependencies: 4822 11
-- Name: relacioncompulsacionhistoricoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioncompulsacionhistoricoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioncompulsacionhistoricoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioncompulsacionhistoricoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioncompulsacionhistoricoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioncompulsacionhistoricoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioncompulsacionhistoricoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 2005 (class 1255 OID 85962)
-- Dependencies: 4822 11
-- Name: relaciondespacho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciondespacho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciondespacho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciondespacho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciondespacho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciondespacho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciondespacho_audit_fun() OWNER TO postgres;

--
-- TOC entry 2006 (class 1255 OID 85963)
-- Dependencies: 4822 11
-- Name: relaciondocumentoedictopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciondocumentoedictopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciondocumentoedictopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciondocumentoedictopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciondocumentoedictopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciondocumentoedictopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciondocumentoedictopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2007 (class 1255 OID 85964)
-- Dependencies: 4822 11
-- Name: relaciondocumentospostulacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciondocumentospostulacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciondocumentospostulacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciondocumentospostulacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciondocumentospostulacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciondocumentospostulacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciondocumentospostulacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2008 (class 1255 OID 85965)
-- Dependencies: 4822 11
-- Name: relacionevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2009 (class 1255 OID 85966)
-- Dependencies: 4822 11
-- Name: relacioneventofuenteinfo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioneventofuenteinfo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioneventofuenteinfo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioneventofuenteinfo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioneventofuenteinfo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioneventofuenteinfo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioneventofuenteinfo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2010 (class 1255 OID 85967)
-- Dependencies: 4822 11
-- Name: relacioneventomodusoperandi_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacioneventomodusoperandi_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacioneventomodusoperandi_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacioneventomodusoperandi_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacioneventomodusoperandi_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacioneventomodusoperandi_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacioneventomodusoperandi_audit_fun() OWNER TO postgres;

--
-- TOC entry 2011 (class 1255 OID 85968)
-- Dependencies: 4822 11
-- Name: relacionfiscaldespachoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionfiscaldespachoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionfiscaldespachoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionfiscaldespachoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionfiscaldespachoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionfiscaldespachoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionfiscaldespachoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2012 (class 1255 OID 85969)
-- Dependencies: 4822 11
-- Name: relacionfuentehistorialpga_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionfuentehistorialpga_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionfuentehistorialpga_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionfuentehistorialpga_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionfuentehistorialpga_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionfuentehistorialpga_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionfuentehistorialpga_audit_fun() OWNER TO postgres;

--
-- TOC entry 2013 (class 1255 OID 85970)
-- Dependencies: 4822 11
-- Name: relacionfuentepersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionfuentepersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionfuentepersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionfuentepersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionfuentepersona_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionfuentepersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionfuentepersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 2014 (class 1255 OID 85971)
-- Dependencies: 4822 11
-- Name: relacionfuncionperfil_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionfuncionperfil_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionfuncionperfil_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionfuncionperfil_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionfuncionperfil_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionfuncionperfil_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionfuncionperfil_audit_fun() OWNER TO postgres;

--
-- TOC entry 2015 (class 1255 OID 85972)
-- Dependencies: 4822 11
-- Name: relaciongenesisgrupoarmadofuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciongenesisgrupoarmadofuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciongenesisgrupoarmadofuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciongenesisgrupoarmadofuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciongenesisgrupoarmadofuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciongenesisgrupoarmadofuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciongenesisgrupoarmadofuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2016 (class 1255 OID 85973)
-- Dependencies: 4822 11
-- Name: relaciongenesisgrupoarmadoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciongenesisgrupoarmadoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciongenesisgrupoarmadoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciongenesisgrupoarmadoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciongenesisgrupoarmadoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciongenesisgrupoarmadoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciongenesisgrupoarmadoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2017 (class 1255 OID 85974)
-- Dependencies: 4822 11
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2018 (class 1255 OID 85975)
-- Dependencies: 4822 11
-- Name: relaciongeoreferenciaciongrupoarmadoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relaciongeoreferenciaciongrupoarmadoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relaciongeoreferenciaciongrupoarmadoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relaciongeoreferenciaciongrupoarmadoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relaciongeoreferenciaciongrupoarmadoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2019 (class 1255 OID 85976)
-- Dependencies: 4822 11
-- Name: relacionhistoricoprocesalfuenteinfo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionhistoricoprocesalfuenteinfo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionhistoricoprocesalfuenteinfo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionhistoricoprocesalfuenteinfo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionhistoricoprocesalfuenteinfo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionhistoricoprocesalfuenteinfo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionhistoricoprocesalfuenteinfo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2020 (class 1255 OID 85977)
-- Dependencies: 4822 11
-- Name: relacionidentificaciongrupoarmadofuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionidentificaciongrupoarmadofuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionidentificaciongrupoarmadofuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionidentificaciongrupoarmadofuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionidentificaciongrupoarmadofuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionidentificaciongrupoarmadofuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionidentificaciongrupoarmadofuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2021 (class 1255 OID 85978)
-- Dependencies: 4822 11
-- Name: relacionidentificaciongrupoarmadoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionidentificaciongrupoarmadoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionidentificaciongrupoarmadoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionidentificaciongrupoarmadoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionidentificaciongrupoarmadoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionidentificaciongrupoarmadoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionidentificaciongrupoarmadoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2023 (class 1255 OID 85979)
-- Dependencies: 4822 11
-- Name: relacionmagistradoaudiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionmagistradoaudiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionmagistradoaudiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionmagistradoaudiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionmagistradoaudiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionmagistradoaudiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionmagistradoaudiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 2024 (class 1255 OID 85980)
-- Dependencies: 4822 11
-- Name: relacionnotificacioncorreopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionnotificacioncorreopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionnotificacioncorreopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionnotificacioncorreopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionnotificacioncorreopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionnotificacioncorreopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionnotificacioncorreopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2025 (class 1255 OID 85981)
-- Dependencies: 4822 11
-- Name: relacionperfilreporte_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionperfilreporte_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionperfilreporte_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionperfilreporte_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionperfilreporte_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionperfilreporte_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionperfilreporte_audit_fun() OWNER TO postgres;

--
-- TOC entry 2026 (class 1255 OID 85982)
-- Dependencies: 4822 11
-- Name: relacionpersonacompulsacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpersonacompulsacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpersonacompulsacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpersonacompulsacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpersonacompulsacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpersonacompulsacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpersonacompulsacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2027 (class 1255 OID 85983)
-- Dependencies: 4822 11
-- Name: relacionpersonajuridicacolectividad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpersonajuridicacolectividad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpersonajuridicacolectividad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpersonajuridicacolectividad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpersonajuridicacolectividad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpersonajuridicacolectividad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpersonajuridicacolectividad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2028 (class 1255 OID 85984)
-- Dependencies: 4822 11
-- Name: relacionpersonaparentesco_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpersonaparentesco_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpersonaparentesco_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpersonaparentesco_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpersonaparentesco_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpersonaparentesco_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpersonaparentesco_audit_fun() OWNER TO postgres;

--
-- TOC entry 2029 (class 1255 OID 85985)
-- Dependencies: 4822 11
-- Name: relacionpostuladoacta_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpostuladoacta_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpostuladoacta_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpostuladoacta_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpostuladoacta_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpostuladoacta_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpostuladoacta_audit_fun() OWNER TO postgres;

--
-- TOC entry 2030 (class 1255 OID 85986)
-- Dependencies: 4822 11
-- Name: relacionpostuladodocumentopostulacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpostuladodocumentopostulacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpostuladodocumentopostulacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpostuladodocumentopostulacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpostuladodocumentopostulacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpostuladodocumentopostulacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpostuladodocumentopostulacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2031 (class 1255 OID 85987)
-- Dependencies: 4822 11
-- Name: relacionpostuladoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpostuladoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpostuladoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpostuladoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpostuladoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpostuladoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpostuladoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2032 (class 1255 OID 85988)
-- Dependencies: 4822 11
-- Name: relacionpublicacionexternapostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpublicacionexternapostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpublicacionexternapostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpublicacionexternapostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpublicacionexternapostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpublicacionexternapostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpublicacionexternapostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2033 (class 1255 OID 85989)
-- Dependencies: 4822 11
-- Name: relacionpublicacioninternapostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionpublicacioninternapostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionpublicacioninternapostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionpublicacioninternapostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionpublicacioninternapostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionpublicacioninternapostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionpublicacioninternapostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2034 (class 1255 OID 85990)
-- Dependencies: 4822 11
-- Name: relacionregistrohechodocumento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionregistrohechodocumento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionregistrohechodocumento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionregistrohechodocumento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionregistrohechodocumento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionregistrohechodocumento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionregistrohechodocumento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2035 (class 1255 OID 85991)
-- Dependencies: 4822 11
-- Name: relacionreporteprogramacionreporte_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionreporteprogramacionreporte_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionreporteprogramacionreporte_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionreporteprogramacionreporte_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionreporteprogramacionreporte_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionreporteprogramacionreporte_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionreporteprogramacionreporte_audit_fun() OWNER TO postgres;

--
-- TOC entry 2036 (class 1255 OID 85992)
-- Dependencies: 4822 11
-- Name: relacionsenalregion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionsenalregion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionsenalregion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionsenalregion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionsenalregion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionsenalregion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionsenalregion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2037 (class 1255 OID 85995)
-- Dependencies: 4822 11
-- Name: relacionversionevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionversionevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionversionevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionversionevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionversionevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionversionevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionversionevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2038 (class 1255 OID 85996)
-- Dependencies: 4822 11
-- Name: relacionversionhistorialpga_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionversionhistorialpga_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionversionhistorialpga_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionversionhistorialpga_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionversionhistorialpga_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionversionhistorialpga_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionversionhistorialpga_audit_fun() OWNER TO postgres;

--
-- TOC entry 2039 (class 1255 OID 85997)
-- Dependencies: 4822 11
-- Name: relacionvictimahecho_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION relacionvictimahecho_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO relacionvictimahecho_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO relacionvictimahecho_audit SELECT 'U', now(), NEW.*;
            INSERT INTO relacionvictimahecho_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO relacionvictimahecho_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.relacionvictimahecho_audit_fun() OWNER TO postgres;

--
-- TOC entry 2040 (class 1255 OID 85998)
-- Dependencies: 4822 11
-- Name: religion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION religion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO religion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO religion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO religion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO religion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.religion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2041 (class 1255 OID 85999)
-- Dependencies: 4822 11
-- Name: reporte_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION reporte_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO reporte_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO reporte_audit SELECT 'U', now(), NEW.*;
            INSERT INTO reporte_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO reporte_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.reporte_audit_fun() OWNER TO postgres;

--
-- TOC entry 2042 (class 1255 OID 86000)
-- Dependencies: 4822 11
-- Name: reposicionterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION reposicionterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO reposicionterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO reposicionterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO reposicionterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO reposicionterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.reposicionterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2043 (class 1255 OID 86001)
-- Dependencies: 4822 11
-- Name: resolucionasignacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION resolucionasignacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO resolucionasignacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO resolucionasignacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO resolucionasignacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO resolucionasignacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.resolucionasignacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2044 (class 1255 OID 86002)
-- Dependencies: 4822 11
-- Name: salaconocimiento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION salaconocimiento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO salaconocimiento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO salaconocimiento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO salaconocimiento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO salaconocimiento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.salaconocimiento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2048 (class 1255 OID 86003)
-- Dependencies: 4822 11
-- Name: salaversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION salaversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO salaversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO salaversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO salaversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO salaversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.salaversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2049 (class 1255 OID 86004)
-- Dependencies: 11
-- Name: sec_to_gc(double precision); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sec_to_gc(double precision) RETURNS double precision
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT CASE WHEN $1 < 0 THEN 0::float8 WHEN $1/(2*earth()) > 1 THEN pi()*earth() ELSE 2*earth()*asin($1/(2*earth())) END$_$;


ALTER FUNCTION public.sec_to_gc(double precision) OWNER TO postgres;

--
-- TOC entry 2050 (class 1255 OID 86005)
-- Dependencies: 2922 2922 11
-- Name: seg_cmp(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_cmp(seg, seg) RETURNS integer
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_cmp';


ALTER FUNCTION public.seg_cmp(seg, seg) OWNER TO postgres;

--
-- TOC entry 8991 (class 0 OID 0)
-- Dependencies: 2050
-- Name: FUNCTION seg_cmp(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_cmp(seg, seg) IS 'btree comparison function';


--
-- TOC entry 2051 (class 1255 OID 86006)
-- Dependencies: 2922 2922 11
-- Name: seg_contained(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_contained(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_contained';


ALTER FUNCTION public.seg_contained(seg, seg) OWNER TO postgres;

--
-- TOC entry 8992 (class 0 OID 0)
-- Dependencies: 2051
-- Name: FUNCTION seg_contained(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_contained(seg, seg) IS 'contained in';


--
-- TOC entry 2052 (class 1255 OID 86007)
-- Dependencies: 2922 2922 11
-- Name: seg_contains(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_contains(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_contains';


ALTER FUNCTION public.seg_contains(seg, seg) OWNER TO postgres;

--
-- TOC entry 8993 (class 0 OID 0)
-- Dependencies: 2052
-- Name: FUNCTION seg_contains(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_contains(seg, seg) IS 'contains';


--
-- TOC entry 2053 (class 1255 OID 86008)
-- Dependencies: 2922 2922 11
-- Name: seg_different(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_different(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_different';


ALTER FUNCTION public.seg_different(seg, seg) OWNER TO postgres;

--
-- TOC entry 8994 (class 0 OID 0)
-- Dependencies: 2053
-- Name: FUNCTION seg_different(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_different(seg, seg) IS 'different';


--
-- TOC entry 2054 (class 1255 OID 86009)
-- Dependencies: 2922 2922 11
-- Name: seg_ge(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_ge(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_ge';


ALTER FUNCTION public.seg_ge(seg, seg) OWNER TO postgres;

--
-- TOC entry 8995 (class 0 OID 0)
-- Dependencies: 2054
-- Name: FUNCTION seg_ge(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_ge(seg, seg) IS 'greater than or equal';


--
-- TOC entry 2055 (class 1255 OID 86010)
-- Dependencies: 2922 2922 11
-- Name: seg_gt(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_gt(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_gt';


ALTER FUNCTION public.seg_gt(seg, seg) OWNER TO postgres;

--
-- TOC entry 8996 (class 0 OID 0)
-- Dependencies: 2055
-- Name: FUNCTION seg_gt(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_gt(seg, seg) IS 'greater than';


--
-- TOC entry 2056 (class 1255 OID 86011)
-- Dependencies: 2922 2922 2922 11
-- Name: seg_inter(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_inter(seg, seg) RETURNS seg
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_inter';


ALTER FUNCTION public.seg_inter(seg, seg) OWNER TO postgres;

--
-- TOC entry 2057 (class 1255 OID 86012)
-- Dependencies: 2922 2922 11
-- Name: seg_le(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_le(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_le';


ALTER FUNCTION public.seg_le(seg, seg) OWNER TO postgres;

--
-- TOC entry 8997 (class 0 OID 0)
-- Dependencies: 2057
-- Name: FUNCTION seg_le(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_le(seg, seg) IS 'less than or equal';


--
-- TOC entry 2058 (class 1255 OID 86013)
-- Dependencies: 2922 2922 11
-- Name: seg_left(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_left(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_left';


ALTER FUNCTION public.seg_left(seg, seg) OWNER TO postgres;

--
-- TOC entry 8998 (class 0 OID 0)
-- Dependencies: 2058
-- Name: FUNCTION seg_left(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_left(seg, seg) IS 'is left of';


--
-- TOC entry 2059 (class 1255 OID 86014)
-- Dependencies: 2922 11
-- Name: seg_lower(seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_lower(seg) RETURNS real
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_lower';


ALTER FUNCTION public.seg_lower(seg) OWNER TO postgres;

--
-- TOC entry 2060 (class 1255 OID 86015)
-- Dependencies: 2922 2922 11
-- Name: seg_lt(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_lt(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_lt';


ALTER FUNCTION public.seg_lt(seg, seg) OWNER TO postgres;

--
-- TOC entry 8999 (class 0 OID 0)
-- Dependencies: 2060
-- Name: FUNCTION seg_lt(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_lt(seg, seg) IS 'less than';


--
-- TOC entry 2061 (class 1255 OID 86016)
-- Dependencies: 2922 2922 11
-- Name: seg_over_left(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_over_left(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_over_left';


ALTER FUNCTION public.seg_over_left(seg, seg) OWNER TO postgres;

--
-- TOC entry 9000 (class 0 OID 0)
-- Dependencies: 2061
-- Name: FUNCTION seg_over_left(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_over_left(seg, seg) IS 'overlaps or is left of';


--
-- TOC entry 2062 (class 1255 OID 86017)
-- Dependencies: 2922 2922 11
-- Name: seg_over_right(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_over_right(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_over_right';


ALTER FUNCTION public.seg_over_right(seg, seg) OWNER TO postgres;

--
-- TOC entry 9001 (class 0 OID 0)
-- Dependencies: 2062
-- Name: FUNCTION seg_over_right(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_over_right(seg, seg) IS 'overlaps or is right of';


--
-- TOC entry 2063 (class 1255 OID 86018)
-- Dependencies: 2922 2922 11
-- Name: seg_overlap(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_overlap(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_overlap';


ALTER FUNCTION public.seg_overlap(seg, seg) OWNER TO postgres;

--
-- TOC entry 9002 (class 0 OID 0)
-- Dependencies: 2063
-- Name: FUNCTION seg_overlap(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_overlap(seg, seg) IS 'overlaps';


--
-- TOC entry 2064 (class 1255 OID 86019)
-- Dependencies: 2922 2922 11
-- Name: seg_right(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_right(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_right';


ALTER FUNCTION public.seg_right(seg, seg) OWNER TO postgres;

--
-- TOC entry 9003 (class 0 OID 0)
-- Dependencies: 2064
-- Name: FUNCTION seg_right(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_right(seg, seg) IS 'is right of';


--
-- TOC entry 2065 (class 1255 OID 86020)
-- Dependencies: 2922 2922 11
-- Name: seg_same(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_same(seg, seg) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_same';


ALTER FUNCTION public.seg_same(seg, seg) OWNER TO postgres;

--
-- TOC entry 9004 (class 0 OID 0)
-- Dependencies: 2065
-- Name: FUNCTION seg_same(seg, seg); Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON FUNCTION seg_same(seg, seg) IS 'same as';


--
-- TOC entry 2066 (class 1255 OID 86021)
-- Dependencies: 2922 11
-- Name: seg_size(seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_size(seg) RETURNS real
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_size';


ALTER FUNCTION public.seg_size(seg) OWNER TO postgres;

--
-- TOC entry 2067 (class 1255 OID 86022)
-- Dependencies: 2922 2922 2922 11
-- Name: seg_union(seg, seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_union(seg, seg) RETURNS seg
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_union';


ALTER FUNCTION public.seg_union(seg, seg) OWNER TO postgres;

--
-- TOC entry 2068 (class 1255 OID 86023)
-- Dependencies: 2922 11
-- Name: seg_upper(seg); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION seg_upper(seg) RETURNS real
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/seg', 'seg_upper';


ALTER FUNCTION public.seg_upper(seg) OWNER TO postgres;

--
-- TOC entry 2069 (class 1255 OID 86024)
-- Dependencies: 4822 11
-- Name: sentenciajyp_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sentenciajyp_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO sentenciaJyP_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO sentenciaJyP_audit SELECT 'U', now(), NEW.*;
            INSERT INTO sentenciaJyP_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO sentenciaJyP_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.sentenciajyp_audit_fun() OWNER TO postgres;

--
-- TOC entry 2070 (class 1255 OID 86025)
-- Dependencies: 11
-- Name: set_limit(real); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION set_limit(real) RETURNS real
    LANGUAGE c STRICT
    AS '$libdir/pg_trgm', 'set_limit';


ALTER FUNCTION public.set_limit(real) OWNER TO postgres;

--
-- TOC entry 2071 (class 1255 OID 86026)
-- Dependencies: 4822 11
-- Name: set_origen_carpeta(integer, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION set_origen_carpeta(integer, character varying) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
DECLARE
valida boolean;
BEGIN
valida := false;

-- VERSION: 1.0
-- AUTOR: JIMMY ALEXANDER CRUZ QUINTERO
-- FGN - UNJYP
-- 2009-12-22
-- BOGOTA - COLOMBIA

-- 1: ID DE LA CARPETA
-- 2: USUARIO

UPDATE carpetahecho SET idorigencarpeta = sub.idorigenevento, fechaorigencarpeta = sub.fecha, usuario = $2
-- Seleccion del origen y fecha origen
FROM
(SELECT idorigenevento, fecha
FROM (
                -- FORMATO
                SELECT idorigenevento, fecharegistrohecho AS fecha
                FROM
                  carpetahecho
                  INNER JOIN relacioncarpetahechoevento ON (carpetahecho.idcarpetahecho = relacioncarpetahechoevento.idcarpetahecho)
                  INNER JOIN evento ON (relacioncarpetahechoevento.idevento = evento.idevento)
                  INNER JOIN registrohecho ON (evento.idevento = registrohecho.idevento)
                WHERE carpetahecho.idcarpetahecho = $1
                UNION
                -- OFICIO
                SELECT idorigenevento, fechainformacion AS fecha
                FROM
                  relacioncarpetahechoevento
                  INNER JOIN carpetahecho ON (relacioncarpetahechoevento.idcarpetahecho = carpetahecho.idcarpetahecho)
                  INNER JOIN evento ON (relacioncarpetahechoevento.idevento = evento.idevento)
                  INNER JOIN relacioneventofuenteinfo ON (evento.idevento = relacioneventofuenteinfo.idevento)
                  INNER JOIN fuenteinformaciondatos ON (relacioneventofuenteinfo.idfuenteinformacion = fuenteinformaciondatos.idfuenteinformacion)
                  WHERE carpetahecho.idcarpetahecho = $1
                UNION
                --VERSION
                SELECT idorigenevento, fechaversion AS fecha
                FROM
                  carpetahecho
                  INNER JOIN relacioncarpetahechoevento ON (carpetahecho.idcarpetahecho = relacioncarpetahechoevento.idcarpetahecho)
                  INNER JOIN evento ON (relacioncarpetahechoevento.idevento = evento.idevento)
                  INNER JOIN relacionversionevento ON (evento.idevento = relacionversionevento.idevento)
                  INNER JOIN "version" ON (relacionversionevento.idversion = "version".idversion)
                  WHERE carpetahecho.idcarpetahecho = $1
                ) AS sub
ORDER BY fecha LIMIT 1) AS sub
WHERE idcarpetahecho = $1;

-- VALOR A RETORNAR
valida:=true;
RETURN valida;
END

$_$;


ALTER FUNCTION public.set_origen_carpeta(integer, character varying) OWNER TO postgres;

--
-- TOC entry 2072 (class 1255 OID 86027)
-- Dependencies: 11
-- Name: set_timetravel(name, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION set_timetravel(name, integer) RETURNS integer
    LANGUAGE c STRICT
    AS '$libdir/timetravel', 'set_timetravel';


ALTER FUNCTION public.set_timetravel(name, integer) OWNER TO postgres;

--
-- TOC entry 2073 (class 1255 OID 86028)
-- Dependencies: 11
-- Name: show_limit(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION show_limit() RETURNS real
    LANGUAGE c STABLE STRICT
    AS '$libdir/pg_trgm', 'show_limit';


ALTER FUNCTION public.show_limit() OWNER TO postgres;

--
-- TOC entry 2074 (class 1255 OID 86029)
-- Dependencies: 11
-- Name: show_trgm(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION show_trgm(text) RETURNS text[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pg_trgm', 'show_trgm';


ALTER FUNCTION public.show_trgm(text) OWNER TO postgres;

--
-- TOC entry 2075 (class 1255 OID 86030)
-- Dependencies: 11
-- Name: similarity(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION similarity(text, text) RETURNS real
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pg_trgm', 'similarity';


ALTER FUNCTION public.similarity(text, text) OWNER TO postgres;

--
-- TOC entry 2076 (class 1255 OID 86031)
-- Dependencies: 11
-- Name: similarity_op(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION similarity_op(text, text) RETURNS boolean
    LANGUAGE c STABLE STRICT
    AS '$libdir/pg_trgm', 'similarity_op';


ALTER FUNCTION public.similarity_op(text, text) OWNER TO postgres;

--
-- TOC entry 2077 (class 1255 OID 86032)
-- Dependencies: 2859 11
-- Name: skeys(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION skeys(hstore) RETURNS SETOF text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'skeys';


ALTER FUNCTION public.skeys(hstore) OWNER TO postgres;

--
-- TOC entry 2078 (class 1255 OID 86033)
-- Dependencies: 4822 11
-- Name: solicitudterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION solicitudterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO solicitudterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO solicitudterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO solicitudterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO solicitudterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.solicitudterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2079 (class 1255 OID 86034)
-- Dependencies: 11
-- Name: sort(integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sort(integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'sort';


ALTER FUNCTION public.sort(integer[]) OWNER TO postgres;

--
-- TOC entry 2080 (class 1255 OID 86035)
-- Dependencies: 11
-- Name: sort(integer[], text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sort(integer[], text) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'sort';


ALTER FUNCTION public.sort(integer[], text) OWNER TO postgres;

--
-- TOC entry 2081 (class 1255 OID 86036)
-- Dependencies: 11
-- Name: sort_asc(integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sort_asc(integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'sort_asc';


ALTER FUNCTION public.sort_asc(integer[]) OWNER TO postgres;

--
-- TOC entry 2082 (class 1255 OID 86037)
-- Dependencies: 11
-- Name: sort_desc(integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION sort_desc(integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'sort_desc';


ALTER FUNCTION public.sort_desc(integer[]) OWNER TO postgres;

--
-- TOC entry 2083 (class 1255 OID 86038)
-- Dependencies: 11
-- Name: soundex(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION soundex(text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'soundex';


ALTER FUNCTION public.soundex(text) OWNER TO postgres;

--
-- TOC entry 2084 (class 1255 OID 86039)
-- Dependencies: 11
-- Name: ssl_client_cert_present(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_client_cert_present() RETURNS boolean
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_client_cert_present';


ALTER FUNCTION public.ssl_client_cert_present() OWNER TO postgres;

--
-- TOC entry 2085 (class 1255 OID 86040)
-- Dependencies: 11
-- Name: ssl_client_dn(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_client_dn() RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_client_dn';


ALTER FUNCTION public.ssl_client_dn() OWNER TO postgres;

--
-- TOC entry 2086 (class 1255 OID 86041)
-- Dependencies: 11
-- Name: ssl_client_dn_field(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_client_dn_field(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_client_dn_field';


ALTER FUNCTION public.ssl_client_dn_field(text) OWNER TO postgres;

--
-- TOC entry 2087 (class 1255 OID 86042)
-- Dependencies: 11
-- Name: ssl_client_serial(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_client_serial() RETURNS numeric
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_client_serial';


ALTER FUNCTION public.ssl_client_serial() OWNER TO postgres;

--
-- TOC entry 2088 (class 1255 OID 86043)
-- Dependencies: 11
-- Name: ssl_is_used(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_is_used() RETURNS boolean
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_is_used';


ALTER FUNCTION public.ssl_is_used() OWNER TO postgres;

--
-- TOC entry 2089 (class 1255 OID 86044)
-- Dependencies: 11
-- Name: ssl_issuer_dn(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_issuer_dn() RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_issuer_dn';


ALTER FUNCTION public.ssl_issuer_dn() OWNER TO postgres;

--
-- TOC entry 2090 (class 1255 OID 86045)
-- Dependencies: 11
-- Name: ssl_issuer_field(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ssl_issuer_field(text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/sslinfo', 'ssl_issuer_field';


ALTER FUNCTION public.ssl_issuer_field(text) OWNER TO postgres;

--
-- TOC entry 2091 (class 1255 OID 86046)
-- Dependencies: 11
-- Name: subarray(integer[], integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION subarray(integer[], integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'subarray';


ALTER FUNCTION public.subarray(integer[], integer) OWNER TO postgres;

--
-- TOC entry 2092 (class 1255 OID 86047)
-- Dependencies: 11
-- Name: subarray(integer[], integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION subarray(integer[], integer, integer) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'subarray';


ALTER FUNCTION public.subarray(integer[], integer, integer) OWNER TO postgres;

--
-- TOC entry 2093 (class 1255 OID 86048)
-- Dependencies: 2882 2882 11
-- Name: subltree(ltree, integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION subltree(ltree, integer, integer) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'subltree';


ALTER FUNCTION public.subltree(ltree, integer, integer) OWNER TO postgres;

--
-- TOC entry 2094 (class 1255 OID 86049)
-- Dependencies: 2882 2882 11
-- Name: subpath(ltree, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION subpath(ltree, integer) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'subpath';


ALTER FUNCTION public.subpath(ltree, integer) OWNER TO postgres;

--
-- TOC entry 2095 (class 1255 OID 86050)
-- Dependencies: 2882 2882 11
-- Name: subpath(ltree, integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION subpath(ltree, integer, integer) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'subpath';


ALTER FUNCTION public.subpath(ltree, integer, integer) OWNER TO postgres;

--
-- TOC entry 2096 (class 1255 OID 86051)
-- Dependencies: 2859 11
-- Name: svals(hstore); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION svals(hstore) RETURNS SETOF text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/hstore', 'svals';


ALTER FUNCTION public.svals(hstore) OWNER TO postgres;

--
-- TOC entry 2097 (class 1255 OID 86052)
-- Dependencies: 2859 11
-- Name: tconvert(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tconvert(text, text) RETURNS hstore
    LANGUAGE c IMMUTABLE
    AS '$libdir/hstore', 'tconvert';


ALTER FUNCTION public.tconvert(text, text) OWNER TO postgres;

--
-- TOC entry 2098 (class 1255 OID 86053)
-- Dependencies: 4822 11
-- Name: tendenciasexual_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tendenciasexual_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tendenciasexual_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tendenciasexual_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tendenciasexual_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tendenciasexual_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tendenciasexual_audit_fun() OWNER TO postgres;

--
-- TOC entry 2099 (class 1255 OID 86054)
-- Dependencies: 4822 11
-- Name: terminacionetapaprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION terminacionetapaprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO terminacionetapaprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO terminacionetapaprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO terminacionetapaprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO terminacionetapaprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.terminacionetapaprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 2100 (class 1255 OID 86055)
-- Dependencies: 2882 11
-- Name: text2ltree(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION text2ltree(text) RETURNS ltree
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/ltree', 'text2ltree';


ALTER FUNCTION public.text2ltree(text) OWNER TO postgres;

--
-- TOC entry 2101 (class 1255 OID 86056)
-- Dependencies: 11
-- Name: text_soundex(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION text_soundex(text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/fuzzystrmatch', 'soundex';


ALTER FUNCTION public.text_soundex(text) OWNER TO postgres;

--
-- TOC entry 2102 (class 1255 OID 86057)
-- Dependencies: 11
-- Name: timetravel(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION timetravel() RETURNS trigger
    LANGUAGE c
    AS '$libdir/timetravel', 'timetravel';


ALTER FUNCTION public.timetravel() OWNER TO postgres;

--
-- TOC entry 2103 (class 1255 OID 86058)
-- Dependencies: 4822 11
-- Name: tipoaccesosalud_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoaccesosalud_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoaccesosalud_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoaccesosalud_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoaccesosalud_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoaccesosalud_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoaccesosalud_audit_fun() OWNER TO postgres;

--
-- TOC entry 2104 (class 1255 OID 86059)
-- Dependencies: 4822 11
-- Name: tipoactaasignacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoactaasignacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoactaasignacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoactaasignacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoactaasignacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoactaasignacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoactaasignacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2105 (class 1255 OID 86060)
-- Dependencies: 4822 11
-- Name: tipoactuacionhistoricoprocesal_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoactuacionhistoricoprocesal_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoactuacionhistoricoprocesal_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoactuacionhistoricoprocesal_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoactuacionhistoricoprocesal_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoactuacionhistoricoprocesal_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoactuacionhistoricoprocesal_audit_fun() OWNER TO postgres;

--
-- TOC entry 2106 (class 1255 OID 86061)
-- Dependencies: 4822 11
-- Name: tipoalbumfotografico_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoalbumfotografico_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoalbumfotografico_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoalbumfotografico_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoalbumfotografico_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoalbumfotografico_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoalbumfotografico_audit_fun() OWNER TO postgres;

--
-- TOC entry 2107 (class 1255 OID 86062)
-- Dependencies: 4822 11
-- Name: tipoaplicaley_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoaplicaley_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoaplicaley_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoaplicaley_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoaplicaley_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoaplicaley_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoaplicaley_audit_fun() OWNER TO postgres;

--
-- TOC entry 2108 (class 1255 OID 86063)
-- Dependencies: 4822 11
-- Name: tipoapoderado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoapoderado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoapoderado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoapoderado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoapoderado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoapoderado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoapoderado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2109 (class 1255 OID 86064)
-- Dependencies: 4822 11
-- Name: tipoaudiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoaudiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoaudiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoaudiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoaudiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoaudiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoaudiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 2110 (class 1255 OID 86065)
-- Dependencies: 4822 11
-- Name: tipocaratula_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipocaratula_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipocaratula_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipocaratula_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipocaratula_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipocaratula_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipocaratula_audit_fun() OWNER TO postgres;

--
-- TOC entry 2111 (class 1255 OID 86066)
-- Dependencies: 4822 11
-- Name: tipoclasificacionpersonajuridica_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoclasificacionpersonajuridica_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoclasificacionpersonajuridica_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoclasificacionpersonajuridica_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoclasificacionpersonajuridica_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoclasificacionpersonajuridica_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoclasificacionpersonajuridica_audit_fun() OWNER TO postgres;

--
-- TOC entry 2112 (class 1255 OID 86067)
-- Dependencies: 4822 11
-- Name: tipocompulsacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipocompulsacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipocompulsacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipocompulsacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipocompulsacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipocompulsacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipocompulsacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2113 (class 1255 OID 86068)
-- Dependencies: 4822 11
-- Name: tipodiscapacidad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodiscapacidad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodiscapacidad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodiscapacidad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodiscapacidad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodiscapacidad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodiscapacidad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2114 (class 1255 OID 86069)
-- Dependencies: 4822 11
-- Name: tipodocumento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2115 (class 1255 OID 86070)
-- Dependencies: 4822 11
-- Name: tipodocumentocarpeta_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentocarpeta_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentocarpeta_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentocarpeta_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentocarpeta_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentocarpeta_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentocarpeta_audit_fun() OWNER TO postgres;

--
-- TOC entry 2116 (class 1255 OID 86071)
-- Dependencies: 4822 11
-- Name: tipodocumentocompulsacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentocompulsacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentocompulsacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentocompulsacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentocompulsacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentocompulsacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentocompulsacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2117 (class 1255 OID 86072)
-- Dependencies: 4822 11
-- Name: tipodocumentoedictoemplazatorio_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentoedictoemplazatorio_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentoedictoemplazatorio_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentoedictoemplazatorio_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentoedictoemplazatorio_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentoedictoemplazatorio_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentoedictoemplazatorio_audit_fun() OWNER TO postgres;

--
-- TOC entry 2118 (class 1255 OID 86073)
-- Dependencies: 4822 11
-- Name: tipodocumentoidentidad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentoidentidad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentoidentidad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentoidentidad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentoidentidad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentoidentidad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentoidentidad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2119 (class 1255 OID 86074)
-- Dependencies: 4822 11
-- Name: tipodocumentopersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentopersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentopersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentopersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentopersona_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentopersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentopersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 2120 (class 1255 OID 86075)
-- Dependencies: 4822 11
-- Name: tipodocumentopostulacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipodocumentopostulacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipodocumentopostulacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipodocumentopostulacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipodocumentopostulacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipodocumentopostulacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipodocumentopostulacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2121 (class 1255 OID 86076)
-- Dependencies: 4822 11
-- Name: tipoedad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoedad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoedad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoedad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoedad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoedad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoedad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2122 (class 1255 OID 86077)
-- Dependencies: 4822 11
-- Name: tipoestadonotificacioncorreo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoestadonotificacioncorreo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoestadonotificacioncorreo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoestadonotificacioncorreo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoestadonotificacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoestadonotificacioncorreo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoestadonotificacioncorreo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2123 (class 1255 OID 86078)
-- Dependencies: 4822 11
-- Name: tipoestadopersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoestadopersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoestadopersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoestadopersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoestadopersona_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoestadopersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoestadopersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 2124 (class 1255 OID 86079)
-- Dependencies: 4822 11
-- Name: tipofecha_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipofecha_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipofecha_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipofecha_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipofecha_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipofecha_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipofecha_audit_fun() OWNER TO postgres;

--
-- TOC entry 2125 (class 1255 OID 86080)
-- Dependencies: 4822 11
-- Name: tipofenomenohistorico_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipofenomenohistorico_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipofenomenohistorico_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipofenomenohistorico_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipofenomenohistorico_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipofenomenohistorico_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipofenomenohistorico_audit_fun() OWNER TO postgres;

--
-- TOC entry 2126 (class 1255 OID 86081)
-- Dependencies: 4822 11
-- Name: tipohechoversion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipohechoversion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipohechoversion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipohechoversion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipohechoversion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipohechoversion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipohechoversion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2127 (class 1255 OID 86082)
-- Dependencies: 4822 11
-- Name: tipohistorialreclusion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipohistorialreclusion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipohistorialreclusion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipohistorialreclusion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipohistorialreclusion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipohistorialreclusion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipohistorialreclusion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2128 (class 1255 OID 86083)
-- Dependencies: 4822 11
-- Name: tipoidentificaciongrupoarmado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoidentificaciongrupoarmado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoidentificaciongrupoarmado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoidentificaciongrupoarmado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoidentificaciongrupoarmado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoidentificaciongrupoarmado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoidentificaciongrupoarmado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2129 (class 1255 OID 86084)
-- Dependencies: 4822 11
-- Name: tipoinactivopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoinactivopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoinactivopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoinactivopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoinactivopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoinactivopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoinactivopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2130 (class 1255 OID 86085)
-- Dependencies: 4822 11
-- Name: tipojefe_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipojefe_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipojefe_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipojefe_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipojefe_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipojefe_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipojefe_audit_fun() OWNER TO postgres;

--
-- TOC entry 2131 (class 1255 OID 86086)
-- Dependencies: 4822 11
-- Name: tipoley_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoley_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoley_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoley_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoley_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoley_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoley_audit_fun() OWNER TO postgres;

--
-- TOC entry 2132 (class 1255 OID 86087)
-- Dependencies: 4822 11
-- Name: tipomediopublicacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipomediopublicacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipomediopublicacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipomediopublicacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipomediopublicacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipomediopublicacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipomediopublicacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2133 (class 1255 OID 86088)
-- Dependencies: 4822 11
-- Name: tipomoneda_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipomoneda_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipomoneda_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipomoneda_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipomoneda_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipomoneda_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipomoneda_audit_fun() OWNER TO postgres;

--
-- TOC entry 2134 (class 1255 OID 86089)
-- Dependencies: 4822 11
-- Name: tiponivelsisben_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiponivelsisben_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiponivelsisben_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiponivelsisben_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiponivelsisben_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiponivelsisben_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiponivelsisben_audit_fun() OWNER TO postgres;

--
-- TOC entry 2135 (class 1255 OID 86090)
-- Dependencies: 4822 11
-- Name: tipoorigenfuenteinformacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoorigenfuenteinformacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoorigenfuenteinformacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoorigenfuenteinformacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoorigenfuenteinformacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoorigenfuenteinformacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoorigenfuenteinformacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2136 (class 1255 OID 86091)
-- Dependencies: 4822 11
-- Name: tipoparticipacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoparticipacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoparticipacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoparticipacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoparticipacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoparticipacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoparticipacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2137 (class 1255 OID 86092)
-- Dependencies: 4822 11
-- Name: tipoparticipanteaudiencia_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoparticipanteaudiencia_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoparticipanteaudiencia_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoparticipanteaudiencia_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoparticipanteaudiencia_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoparticipanteaudiencia_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoparticipanteaudiencia_audit_fun() OWNER TO postgres;

--
-- TOC entry 2138 (class 1255 OID 86093)
-- Dependencies: 4822 11
-- Name: tipoperfilfotopersona_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoperfilfotopersona_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoperfilfotopersona_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoperfilfotopersona_audit SELECT 'U', now(), NEW.*;
            INSERT INTO estadopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoperfilfotopersona_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoperfilfotopersona_audit_fun() OWNER TO postgres;

--
-- TOC entry 2139 (class 1255 OID 86094)
-- Dependencies: 4822 11
-- Name: tipopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2140 (class 1255 OID 86095)
-- Dependencies: 4822 11
-- Name: tipopreclusionpostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipopreclusionpostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipopreclusionpostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipopreclusionpostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipopreclusionpostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipopreclusionpostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipopreclusionpostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2141 (class 1255 OID 86096)
-- Dependencies: 4822 11
-- Name: tipoprocesojyp_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoprocesojyp_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoprocesojyp_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoprocesojyp_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoprocesojyp_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoprocesojyp_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoprocesojyp_audit_fun() OWNER TO postgres;

--
-- TOC entry 2142 (class 1255 OID 86097)
-- Dependencies: 4822 11
-- Name: tiporangoedad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiporangoedad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiporangoedad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiporangoedad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiporangoedad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiporangoedad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiporangoedad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2143 (class 1255 OID 86098)
-- Dependencies: 4822 11
-- Name: tiporelacionevento_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiporelacionevento_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiporelacionevento_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiporelacionevento_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiporelacionevento_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiporelacionevento_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiporelacionevento_audit_fun() OWNER TO postgres;

--
-- TOC entry 2144 (class 1255 OID 86099)
-- Dependencies: 4822 11
-- Name: tiporelacionpersonajuridicacolectividad_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiporelacionpersonajuridicacolectividad_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiporelacionpersonajuridicacolectividad_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiporelacionpersonajuridicacolectividad_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiporelacionpersonajuridicacolectividad_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiporelacionpersonajuridicacolectividad_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiporelacionpersonajuridicacolectividad_audit_fun() OWNER TO postgres;

--
-- TOC entry 2145 (class 1255 OID 86100)
-- Dependencies: 4822 11
-- Name: tiposectortrabajo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiposectortrabajo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiposectortrabajo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiposectortrabajo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiposectortrabajo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiposectortrabajo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiposectortrabajo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2146 (class 1255 OID 86101)
-- Dependencies: 4822 11
-- Name: tiposubclasificacionpersonajuridica_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tiposubclasificacionpersonajuridica_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tiposubclasificacionpersonajuridica_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tiposubclasificacionpersonajuridica_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tiposubclasificacionpersonajuridica_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tiposubclasificacionpersonajuridica_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tiposubclasificacionpersonajuridica_audit_fun() OWNER TO postgres;

--
-- TOC entry 2147 (class 1255 OID 86102)
-- Dependencies: 4822 11
-- Name: tipoterminacionprocesopostulado_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoterminacionprocesopostulado_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoterminacionprocesopostulado_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoterminacionprocesopostulado_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoterminacionprocesopostulado_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoterminacionprocesopostulado_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoterminacionprocesopostulado_audit_fun() OWNER TO postgres;

--
-- TOC entry 2148 (class 1255 OID 86103)
-- Dependencies: 4822 11
-- Name: tipotrabajo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipotrabajo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipotrabajo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipotrabajo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipotrabajo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipotrabajo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipotrabajo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2149 (class 1255 OID 86104)
-- Dependencies: 4822 11
-- Name: tipoubicacion_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoubicacion_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoubicacion_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoubicacion_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoubicacion_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoubicacion_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoubicacion_audit_fun() OWNER TO postgres;

--
-- TOC entry 2150 (class 1255 OID 86105)
-- Dependencies: 4822 11
-- Name: tipoubicacioncuerpo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION tipoubicacioncuerpo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO tipoubicacioncuerpo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO tipoubicacioncuerpo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO tipoubicacioncuerpo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO tipoubicacioncuerpo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.tipoubicacioncuerpo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2151 (class 1255 OID 86106)
-- Dependencies: 4822 11
-- Name: titularbien_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION titularbien_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO titularbien_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO titularbien_audit SELECT 'U', now(), NEW.*;
            INSERT INTO titularbien_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO titularbien_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.titularbien_audit_fun() OWNER TO postgres;

--
-- TOC entry 2152 (class 1255 OID 86107)
-- Dependencies: 4822 11
-- Name: trabajo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION trabajo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO trabajo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO trabajo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO trabajo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO trabajo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.trabajo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2153 (class 1255 OID 86108)
-- Dependencies: 4822 11
-- Name: ubicacioncuerpo_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION ubicacioncuerpo_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO ubicacioncuerpo_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO ubicacioncuerpo_audit SELECT 'U', now(), NEW.*;
            INSERT INTO ubicacioncuerpo_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO ubicacioncuerpo_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.ubicacioncuerpo_audit_fun() OWNER TO postgres;

--
-- TOC entry 2154 (class 1255 OID 86109)
-- Dependencies: 11
-- Name: uniq(integer[]); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uniq(integer[]) RETURNS integer[]
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/_int', 'uniq';


ALTER FUNCTION public.uniq(integer[]) OWNER TO postgres;

--
-- TOC entry 2155 (class 1255 OID 86110)
-- Dependencies: 2823 2932 11
-- Name: upc(ean13); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION upc(ean13) RETURNS upc
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/isn', 'upc_cast_from_ean13';


ALTER FUNCTION public.upc(ean13) OWNER TO postgres;

--
-- TOC entry 2156 (class 1255 OID 86111)
-- Dependencies: 4822 11
-- Name: users_names(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION users_names(text) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE    
    user_name text;
    
BEGIN
     SELECT PersonName(users.primerapellido,
			users.segundoapellido, users.primernombre,
			users.segundonombre ) INTO user_name FROM usuario users WHERE "login" = $1;
    RETURN user_name;
END;
$_$;


ALTER FUNCTION public.users_names(text) OWNER TO postgres;

--
-- TOC entry 2157 (class 1255 OID 86112)
-- Dependencies: 4822 11
-- Name: usuario_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION usuario_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
        --
        -- 
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO usuario_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO usuario_audit SELECT 'U', now(), NEW.*;
            INSERT INTO usuario_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO usuario_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.usuario_audit_fun() OWNER TO postgres;

--
-- TOC entry 2158 (class 1255 OID 86113)
-- Dependencies: 11
-- Name: uuid_generate_v1(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_generate_v1() RETURNS uuid
    LANGUAGE c STRICT
    AS '$libdir/uuid-ossp', 'uuid_generate_v1';


ALTER FUNCTION public.uuid_generate_v1() OWNER TO postgres;

--
-- TOC entry 2159 (class 1255 OID 86114)
-- Dependencies: 11
-- Name: uuid_generate_v1mc(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_generate_v1mc() RETURNS uuid
    LANGUAGE c STRICT
    AS '$libdir/uuid-ossp', 'uuid_generate_v1mc';


ALTER FUNCTION public.uuid_generate_v1mc() OWNER TO postgres;

--
-- TOC entry 2160 (class 1255 OID 86115)
-- Dependencies: 11
-- Name: uuid_generate_v3(uuid, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_generate_v3(namespace uuid, name text) RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_generate_v3';


ALTER FUNCTION public.uuid_generate_v3(namespace uuid, name text) OWNER TO postgres;

--
-- TOC entry 2161 (class 1255 OID 86116)
-- Dependencies: 11
-- Name: uuid_generate_v4(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_generate_v4() RETURNS uuid
    LANGUAGE c STRICT
    AS '$libdir/uuid-ossp', 'uuid_generate_v4';


ALTER FUNCTION public.uuid_generate_v4() OWNER TO postgres;

--
-- TOC entry 2162 (class 1255 OID 86117)
-- Dependencies: 11
-- Name: uuid_generate_v5(uuid, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_generate_v5(namespace uuid, name text) RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_generate_v5';


ALTER FUNCTION public.uuid_generate_v5(namespace uuid, name text) OWNER TO postgres;

--
-- TOC entry 2163 (class 1255 OID 86118)
-- Dependencies: 11
-- Name: uuid_nil(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_nil() RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_nil';


ALTER FUNCTION public.uuid_nil() OWNER TO postgres;

--
-- TOC entry 2164 (class 1255 OID 86119)
-- Dependencies: 11
-- Name: uuid_ns_dns(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_ns_dns() RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_ns_dns';


ALTER FUNCTION public.uuid_ns_dns() OWNER TO postgres;

--
-- TOC entry 2165 (class 1255 OID 86120)
-- Dependencies: 11
-- Name: uuid_ns_oid(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_ns_oid() RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_ns_oid';


ALTER FUNCTION public.uuid_ns_oid() OWNER TO postgres;

--
-- TOC entry 2166 (class 1255 OID 86121)
-- Dependencies: 11
-- Name: uuid_ns_url(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_ns_url() RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_ns_url';


ALTER FUNCTION public.uuid_ns_url() OWNER TO postgres;

--
-- TOC entry 2167 (class 1255 OID 86122)
-- Dependencies: 11
-- Name: uuid_ns_x500(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION uuid_ns_x500() RETURNS uuid
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/uuid-ossp', 'uuid_ns_x500';


ALTER FUNCTION public.uuid_ns_x500() OWNER TO postgres;

--
-- TOC entry 2168 (class 1255 OID 86123)
-- Dependencies: 4822 11
-- Name: validadelito(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION validadelito(integer) RETURNS character varying
    LANGUAGE plpgsql
    AS $_$
DECLARE    
    evento integer;
    
BEGIN
     SELECT idevento INTO evento FROM hecho WHERE idevento = $1;
    RETURN evento;
END;
$_$;


ALTER FUNCTION public.validadelito(integer) OWNER TO postgres;

--
-- TOC entry 2169 (class 1255 OID 86124)
-- Dependencies: 4822 11
-- Name: version_audit_fun(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION version_audit_fun() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
       IF (TG_OP = 'DELETE') THEN
            INSERT INTO version_audit SELECT 'D', now(),  OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO version_audit SELECT 'U', now(), NEW.*;
            INSERT INTO version_audit SELECT 'X', now(), OLD.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO version_audit SELECT 'I', now(), NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$$;


ALTER FUNCTION public.version_audit_fun() OWNER TO postgres;

--
-- TOC entry 2170 (class 1255 OID 86125)
-- Dependencies: 11
-- Name: xml_encode_special_chars(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xml_encode_special_chars(text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xml_encode_special_chars';


ALTER FUNCTION public.xml_encode_special_chars(text) OWNER TO postgres;

--
-- TOC entry 2171 (class 1255 OID 86126)
-- Dependencies: 11
-- Name: xml_is_well_formed(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xml_is_well_formed(text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xml_is_well_formed';


ALTER FUNCTION public.xml_is_well_formed(text) OWNER TO postgres;

--
-- TOC entry 2172 (class 1255 OID 86127)
-- Dependencies: 11
-- Name: xml_valid(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xml_valid(text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xml_is_well_formed';


ALTER FUNCTION public.xml_valid(text) OWNER TO postgres;

--
-- TOC entry 2173 (class 1255 OID 86128)
-- Dependencies: 11
-- Name: xpath_bool(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_bool(text, text) RETURNS boolean
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xpath_bool';


ALTER FUNCTION public.xpath_bool(text, text) OWNER TO postgres;

--
-- TOC entry 2174 (class 1255 OID 86129)
-- Dependencies: 11
-- Name: xpath_list(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_list(text, text) RETURNS text
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT xpath_list($1,$2)$_$;


ALTER FUNCTION public.xpath_list(text, text) OWNER TO postgres;

--
-- TOC entry 2175 (class 1255 OID 86130)
-- Dependencies: 11
-- Name: xpath_list(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_list(text, text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xpath_list';


ALTER FUNCTION public.xpath_list(text, text, text) OWNER TO postgres;

--
-- TOC entry 2176 (class 1255 OID 86131)
-- Dependencies: 11
-- Name: xpath_nodeset(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_nodeset(text, text) RETURNS text
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT xpath_nodeset($1,$2)$_$;


ALTER FUNCTION public.xpath_nodeset(text, text) OWNER TO postgres;

--
-- TOC entry 2177 (class 1255 OID 86132)
-- Dependencies: 11
-- Name: xpath_nodeset(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_nodeset(text, text, text) RETURNS text
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT xpath_nodeset($1,$2,$3)$_$;


ALTER FUNCTION public.xpath_nodeset(text, text, text) OWNER TO postgres;

--
-- TOC entry 1994 (class 1255 OID 86133)
-- Dependencies: 11
-- Name: xpath_nodeset(text, text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_nodeset(text, text, text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xpath_nodeset';


ALTER FUNCTION public.xpath_nodeset(text, text, text, text) OWNER TO postgres;

--
-- TOC entry 1995 (class 1255 OID 86134)
-- Dependencies: 11
-- Name: xpath_number(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_number(text, text) RETURNS real
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xpath_number';


ALTER FUNCTION public.xpath_number(text, text) OWNER TO postgres;

--
-- TOC entry 1996 (class 1255 OID 86135)
-- Dependencies: 11
-- Name: xpath_string(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_string(text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xpath_string';


ALTER FUNCTION public.xpath_string(text, text) OWNER TO postgres;

--
-- TOC entry 1997 (class 1255 OID 86136)
-- Dependencies: 11
-- Name: xpath_table(text, text, text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xpath_table(text, text, text, text, text) RETURNS SETOF record
    LANGUAGE c STABLE STRICT
    AS '$libdir/pgxml', 'xpath_table';


ALTER FUNCTION public.xpath_table(text, text, text, text, text) OWNER TO postgres;

--
-- TOC entry 1998 (class 1255 OID 86137)
-- Dependencies: 11
-- Name: xslt_process(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xslt_process(text, text) RETURNS text
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/pgxml', 'xslt_process';


ALTER FUNCTION public.xslt_process(text, text) OWNER TO postgres;

--
-- TOC entry 2022 (class 1255 OID 86138)
-- Dependencies: 11
-- Name: xslt_process(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION xslt_process(text, text, text) RETURNS text
    LANGUAGE c STRICT
    AS '$libdir/pgxml', 'xslt_process';


ALTER FUNCTION public.xslt_process(text, text, text) OWNER TO postgres;

--
-- TOC entry 5529 (class 2617 OID 86139)
-- Dependencies: 1678 11
-- Name: #; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR # (
    PROCEDURE = icount,
    RIGHTARG = integer[]
);


ALTER OPERATOR public.# (NONE, integer[]) OWNER TO postgres;

--
-- TOC entry 5530 (class 2617 OID 86140)
-- Dependencies: 1681 11
-- Name: #; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR # (
    PROCEDURE = idx,
    LEFTARG = integer[],
    RIGHTARG = integer
);


ALTER OPERATOR public.# (integer[], integer) OWNER TO postgres;

--
-- TOC entry 5531 (class 2617 OID 86141)
-- Dependencies: 2076 11
-- Name: %; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR % (
    PROCEDURE = similarity_op,
    LEFTARG = text,
    RIGHTARG = text,
    COMMUTATOR = %,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.% (text, text) OWNER TO postgres;

--
-- TOC entry 5532 (class 2617 OID 86142)
-- Dependencies: 1256 11
-- Name: &; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR & (
    PROCEDURE = _int_inter,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = &
);


ALTER OPERATOR public.& (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5533 (class 2617 OID 86143)
-- Dependencies: 1285 2816 2816 11
-- Name: &&; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR && (
    PROCEDURE = cube_overlap,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = &&,
    RESTRICT = areasel,
    JOIN = areajoinsel
);


ALTER OPERATOR public.&& (cube, cube) OWNER TO postgres;

--
-- TOC entry 5534 (class 2617 OID 86144)
-- Dependencies: 1257 11
-- Name: &&; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR && (
    PROCEDURE = _int_overlap,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = &&,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.&& (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5535 (class 2617 OID 86145)
-- Dependencies: 2063 2922 2922 11
-- Name: &&; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR && (
    PROCEDURE = seg_overlap,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = &&,
    RESTRICT = areasel,
    JOIN = areajoinsel
);


ALTER OPERATOR public.&& (seg, seg) OWNER TO postgres;

--
-- TOC entry 5536 (class 2617 OID 86146)
-- Dependencies: 2061 2922 2922 11
-- Name: &<; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR &< (
    PROCEDURE = seg_over_left,
    LEFTARG = seg,
    RIGHTARG = seg,
    RESTRICT = positionsel,
    JOIN = positionjoinsel
);


ALTER OPERATOR public.&< (seg, seg) OWNER TO postgres;

--
-- TOC entry 5537 (class 2617 OID 86147)
-- Dependencies: 2062 2922 2922 11
-- Name: &>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR &> (
    PROCEDURE = seg_over_right,
    LEFTARG = seg,
    RIGHTARG = seg,
    RESTRICT = positionsel,
    JOIN = positionjoinsel
);


ALTER OPERATOR public.&> (seg, seg) OWNER TO postgres;

--
-- TOC entry 5538 (class 2617 OID 86148)
-- Dependencies: 1638 11
-- Name: +; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR + (
    PROCEDURE = intarray_push_elem,
    LEFTARG = integer[],
    RIGHTARG = integer
);


ALTER OPERATOR public.+ (integer[], integer) OWNER TO postgres;

--
-- TOC entry 5540 (class 2617 OID 86149)
-- Dependencies: 1637 11
-- Name: +; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR + (
    PROCEDURE = intarray_push_array,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = +
);


ALTER OPERATOR public.+ (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5541 (class 2617 OID 86150)
-- Dependencies: 1636 11
-- Name: -; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR - (
    PROCEDURE = intarray_del_elem,
    LEFTARG = integer[],
    RIGHTARG = integer
);


ALTER OPERATOR public.- (integer[], integer) OWNER TO postgres;

--
-- TOC entry 5542 (class 2617 OID 86151)
-- Dependencies: 1666 11
-- Name: -; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR - (
    PROCEDURE = intset_subtract,
    LEFTARG = integer[],
    RIGHTARG = integer[]
);


ALTER OPERATOR public.- (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5543 (class 2617 OID 86152)
-- Dependencies: 1476 2859 11
-- Name: ->; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR -> (
    PROCEDURE = fetchval,
    LEFTARG = hstore,
    RIGHTARG = text
);


ALTER OPERATOR public.-> (hstore, text) OWNER TO postgres;

--
-- TOC entry 5546 (class 2617 OID 86155)
-- Dependencies: 1423 2816 2816 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = cube_lt,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (cube, cube) OWNER TO postgres;

--
-- TOC entry 5549 (class 2617 OID 86158)
-- Dependencies: 1808 2823 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5552 (class 2617 OID 86161)
-- Dependencies: 1810 2867 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5555 (class 2617 OID 86164)
-- Dependencies: 1819 2823 2867 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5558 (class 2617 OID 86167)
-- Dependencies: 1812 2890 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5561 (class 2617 OID 86170)
-- Dependencies: 1825 2823 2890 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5563 (class 2617 OID 86173)
-- Dependencies: 1814 2900 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5566 (class 2617 OID 86176)
-- Dependencies: 1831 2823 2900 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5569 (class 2617 OID 86179)
-- Dependencies: 1809 2863 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5572 (class 2617 OID 86182)
-- Dependencies: 1816 2823 2863 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5575 (class 2617 OID 86185)
-- Dependencies: 1811 2884 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5578 (class 2617 OID 86188)
-- Dependencies: 1822 2823 2884 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5580 (class 2617 OID 86191)
-- Dependencies: 1813 2894 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5583 (class 2617 OID 86194)
-- Dependencies: 1828 2823 2894 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5585 (class 2617 OID 86197)
-- Dependencies: 1815 2932 2823 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5589 (class 2617 OID 86200)
-- Dependencies: 1834 2823 2932 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5592 (class 2617 OID 86203)
-- Dependencies: 1821 2867 2867 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5595 (class 2617 OID 86206)
-- Dependencies: 1820 2863 2867 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5598 (class 2617 OID 86209)
-- Dependencies: 1818 2867 2863 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5601 (class 2617 OID 86212)
-- Dependencies: 1817 2863 2863 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5604 (class 2617 OID 86215)
-- Dependencies: 1827 2890 2890 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5607 (class 2617 OID 86218)
-- Dependencies: 1826 2884 2890 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5610 (class 2617 OID 86221)
-- Dependencies: 1824 2890 2884 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5613 (class 2617 OID 86224)
-- Dependencies: 1823 2884 2884 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5616 (class 2617 OID 86227)
-- Dependencies: 1833 2900 2900 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5619 (class 2617 OID 86230)
-- Dependencies: 1832 2894 2900 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5622 (class 2617 OID 86233)
-- Dependencies: 1830 2900 2894 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5625 (class 2617 OID 86236)
-- Dependencies: 1829 2894 2894 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (issn, issn) OWNER TO postgres;

--
-- TOC entry 5628 (class 2617 OID 86239)
-- Dependencies: 1835 2932 2932 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = isnlt,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (upc, upc) OWNER TO postgres;

--
-- TOC entry 5631 (class 2617 OID 86242)
-- Dependencies: 1897 2882 2882 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = ltree_lt,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.< (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5633 (class 2617 OID 86245)
-- Dependencies: 2060 2922 2922 11
-- Name: <; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR < (
    PROCEDURE = seg_lt,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = >,
    NEGATOR = >=,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.< (seg, seg) OWNER TO postgres;

--
-- TOC entry 5635 (class 2617 OID 86247)
-- Dependencies: 2058 2922 2922 11
-- Name: <<; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR << (
    PROCEDURE = seg_left,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = >>,
    RESTRICT = positionsel,
    JOIN = positionjoinsel
);


ALTER OPERATOR public.<< (seg, seg) OWNER TO postgres;

--
-- TOC entry 5636 (class 2617 OID 86248)
-- Dependencies: 1421 2816 2816 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = cube_le,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (cube, cube) OWNER TO postgres;

--
-- TOC entry 5638 (class 2617 OID 86249)
-- Dependencies: 1780 2823 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5639 (class 2617 OID 86250)
-- Dependencies: 1782 2867 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5640 (class 2617 OID 86251)
-- Dependencies: 1791 2823 2867 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5641 (class 2617 OID 86252)
-- Dependencies: 1784 2890 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5642 (class 2617 OID 86253)
-- Dependencies: 1797 2823 2890 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5643 (class 2617 OID 86254)
-- Dependencies: 1786 2900 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5644 (class 2617 OID 86255)
-- Dependencies: 1803 2823 2900 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5645 (class 2617 OID 86256)
-- Dependencies: 1781 2863 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5646 (class 2617 OID 86257)
-- Dependencies: 1788 2823 2863 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5647 (class 2617 OID 86258)
-- Dependencies: 1783 2884 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5648 (class 2617 OID 86259)
-- Dependencies: 1794 2823 2884 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5649 (class 2617 OID 86260)
-- Dependencies: 1785 2894 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5650 (class 2617 OID 86261)
-- Dependencies: 1800 2823 2894 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5651 (class 2617 OID 86262)
-- Dependencies: 1787 2932 2823 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5652 (class 2617 OID 86263)
-- Dependencies: 1806 2823 2932 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5653 (class 2617 OID 86264)
-- Dependencies: 1793 2867 2867 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5654 (class 2617 OID 86265)
-- Dependencies: 1792 2863 2867 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5655 (class 2617 OID 86266)
-- Dependencies: 1790 2867 2863 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5656 (class 2617 OID 86267)
-- Dependencies: 1789 2863 2863 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5657 (class 2617 OID 86268)
-- Dependencies: 1799 2890 2890 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5658 (class 2617 OID 86269)
-- Dependencies: 1798 2884 2890 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5659 (class 2617 OID 86270)
-- Dependencies: 1796 2890 2884 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5660 (class 2617 OID 86271)
-- Dependencies: 1795 2884 2884 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5661 (class 2617 OID 86272)
-- Dependencies: 1805 2900 2900 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5662 (class 2617 OID 86273)
-- Dependencies: 1804 2894 2900 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5663 (class 2617 OID 86274)
-- Dependencies: 1802 2900 2894 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5664 (class 2617 OID 86275)
-- Dependencies: 1801 2894 2894 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (issn, issn) OWNER TO postgres;

--
-- TOC entry 5665 (class 2617 OID 86276)
-- Dependencies: 1807 2932 2932 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = isnle,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (upc, upc) OWNER TO postgres;

--
-- TOC entry 5666 (class 2617 OID 86277)
-- Dependencies: 1896 2882 2882 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = ltree_le,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<= (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5667 (class 2617 OID 86278)
-- Dependencies: 2057 2922 2922 11
-- Name: <=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <= (
    PROCEDURE = seg_le,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = >=,
    NEGATOR = >,
    RESTRICT = scalarltsel,
    JOIN = scalarltjoinsel
);


ALTER OPERATOR public.<= (seg, seg) OWNER TO postgres;

--
-- TOC entry 5669 (class 2617 OID 86280)
-- Dependencies: 1926 2810 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = ne,
    LEFTARG = chkpass,
    RIGHTARG = text,
    NEGATOR = =
);


ALTER OPERATOR public.<> (chkpass, text) OWNER TO postgres;

--
-- TOC entry 5672 (class 2617 OID 86282)
-- Dependencies: 1284 2816 2816 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = cube_ne,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (cube, cube) OWNER TO postgres;

--
-- TOC entry 5674 (class 2617 OID 86284)
-- Dependencies: 1836 2823 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5673 (class 2617 OID 86285)
-- Dependencies: 1838 2867 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5676 (class 2617 OID 86287)
-- Dependencies: 1847 2823 2867 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5682 (class 2617 OID 86289)
-- Dependencies: 1840 2890 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5680 (class 2617 OID 86291)
-- Dependencies: 1853 2823 2890 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5677 (class 2617 OID 86293)
-- Dependencies: 1842 2900 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5683 (class 2617 OID 86295)
-- Dependencies: 1859 2823 2900 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5684 (class 2617 OID 86297)
-- Dependencies: 1837 2863 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5686 (class 2617 OID 86299)
-- Dependencies: 1844 2823 2863 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5694 (class 2617 OID 86301)
-- Dependencies: 1839 2884 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5692 (class 2617 OID 86303)
-- Dependencies: 1850 2823 2884 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5699 (class 2617 OID 86305)
-- Dependencies: 1841 2894 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5697 (class 2617 OID 86307)
-- Dependencies: 1856 2823 2894 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5704 (class 2617 OID 86309)
-- Dependencies: 1843 2932 2823 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5701 (class 2617 OID 86311)
-- Dependencies: 1862 2823 2932 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5707 (class 2617 OID 86314)
-- Dependencies: 1849 2867 2867 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5712 (class 2617 OID 86315)
-- Dependencies: 1848 2863 2867 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5710 (class 2617 OID 86317)
-- Dependencies: 1846 2867 2863 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5695 (class 2617 OID 86320)
-- Dependencies: 1845 2863 2863 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5708 (class 2617 OID 86322)
-- Dependencies: 1855 2890 2890 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5717 (class 2617 OID 86323)
-- Dependencies: 1854 2884 2890 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5715 (class 2617 OID 86325)
-- Dependencies: 1852 2890 2884 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5720 (class 2617 OID 86328)
-- Dependencies: 1851 2884 2884 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5723 (class 2617 OID 86330)
-- Dependencies: 1861 2900 2900 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5724 (class 2617 OID 86331)
-- Dependencies: 1860 2894 2900 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5713 (class 2617 OID 86333)
-- Dependencies: 1858 2900 2894 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5727 (class 2617 OID 86336)
-- Dependencies: 1857 2894 2894 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (issn, issn) OWNER TO postgres;

--
-- TOC entry 5725 (class 2617 OID 86338)
-- Dependencies: 1863 2932 2932 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = isnne,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (upc, upc) OWNER TO postgres;

--
-- TOC entry 5730 (class 2617 OID 86340)
-- Dependencies: 1898 2882 2882 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = ltree_ne,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5731 (class 2617 OID 86342)
-- Dependencies: 2053 2922 2922 11
-- Name: <>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <> (
    PROCEDURE = seg_different,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = <>,
    NEGATOR = =,
    RESTRICT = neqsel,
    JOIN = neqjoinsel
);


ALTER OPERATOR public.<> (seg, seg) OWNER TO postgres;

--
-- TOC entry 5732 (class 2617 OID 86344)
-- Dependencies: 1414 2816 2816 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = cube_contained,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (cube, cube) OWNER TO postgres;

--
-- TOC entry 5734 (class 2617 OID 86346)
-- Dependencies: 1676 2859 2859 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = hs_contained,
    LEFTARG = hstore,
    RIGHTARG = hstore,
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (hstore, hstore) OWNER TO postgres;

--
-- TOC entry 5736 (class 2617 OID 86348)
-- Dependencies: 1253 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = _int_contained,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5738 (class 2617 OID 86350)
-- Dependencies: 1905 1901 2882 2882 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = ltree_risparent,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = @>,
    RESTRICT = ltreeparentsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5741 (class 2617 OID 86352)
-- Dependencies: 1272 2888 2882 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = _ltree_r_isparent,
    LEFTARG = ltree,
    RIGHTARG = ltree[],
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 5743 (class 2617 OID 86354)
-- Dependencies: 1274 2882 2888 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = _ltree_risparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree,
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5744 (class 2617 OID 86356)
-- Dependencies: 2051 2922 2922 11
-- Name: <@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@ (
    PROCEDURE = seg_contained,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = @>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.<@ (seg, seg) OWNER TO postgres;

--
-- TOC entry 5746 (class 2617 OID 86357)
-- Dependencies: 1610 11
-- Name: <@>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR <@> (
    PROCEDURE = geo_distance,
    LEFTARG = point,
    RIGHTARG = point,
    COMMUTATOR = <@>
);


ALTER OPERATOR public.<@> (point, point) OWNER TO postgres;

--
-- TOC entry 5668 (class 2617 OID 86279)
-- Dependencies: 1456 2810 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = eq,
    LEFTARG = chkpass,
    RIGHTARG = text,
    NEGATOR = <>
);


ALTER OPERATOR public.= (chkpass, text) OWNER TO postgres;

--
-- TOC entry 5671 (class 2617 OID 86281)
-- Dependencies: 1417 2816 2816 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = cube_eq,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (cube, cube) OWNER TO postgres;

--
-- TOC entry 5670 (class 2617 OID 86283)
-- Dependencies: 1702 2823 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5687 (class 2617 OID 86286)
-- Dependencies: 1713 2823 2867 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5675 (class 2617 OID 86288)
-- Dependencies: 1704 2867 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5681 (class 2617 OID 86290)
-- Dependencies: 1719 2823 2890 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5679 (class 2617 OID 86292)
-- Dependencies: 1706 2890 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5685 (class 2617 OID 86294)
-- Dependencies: 1725 2823 2900 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5678 (class 2617 OID 86296)
-- Dependencies: 1708 2900 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5748 (class 2617 OID 86298)
-- Dependencies: 1710 2823 2863 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5689 (class 2617 OID 86300)
-- Dependencies: 1703 2863 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5739 (class 2617 OID 86302)
-- Dependencies: 1716 2823 2884 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5691 (class 2617 OID 86304)
-- Dependencies: 1705 2884 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5698 (class 2617 OID 86306)
-- Dependencies: 1722 2823 2894 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5696 (class 2617 OID 86308)
-- Dependencies: 1707 2894 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5703 (class 2617 OID 86310)
-- Dependencies: 1372 2823 2932 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5700 (class 2617 OID 86312)
-- Dependencies: 1709 2932 2823 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5706 (class 2617 OID 86313)
-- Dependencies: 1715 2867 2867 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5711 (class 2617 OID 86316)
-- Dependencies: 1712 2867 2863 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5709 (class 2617 OID 86318)
-- Dependencies: 1714 2863 2867 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5693 (class 2617 OID 86319)
-- Dependencies: 1711 2863 2863 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5705 (class 2617 OID 86321)
-- Dependencies: 1721 2890 2890 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5716 (class 2617 OID 86324)
-- Dependencies: 1718 2890 2884 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5714 (class 2617 OID 86326)
-- Dependencies: 1720 2884 2890 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5719 (class 2617 OID 86327)
-- Dependencies: 1717 2884 2884 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5722 (class 2617 OID 86329)
-- Dependencies: 1371 2900 2900 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5721 (class 2617 OID 86332)
-- Dependencies: 1724 2900 2894 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5702 (class 2617 OID 86334)
-- Dependencies: 1370 2894 2900 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5726 (class 2617 OID 86335)
-- Dependencies: 1723 2894 2894 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (issn, issn) OWNER TO postgres;

--
-- TOC entry 5718 (class 2617 OID 86337)
-- Dependencies: 1373 2932 2932 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = isneq,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    HASHES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (upc, upc) OWNER TO postgres;

--
-- TOC entry 5729 (class 2617 OID 86339)
-- Dependencies: 1892 2882 2882 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = ltree_eq,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5728 (class 2617 OID 86341)
-- Dependencies: 2065 2922 2922 11
-- Name: =; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR = (
    PROCEDURE = seg_same,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = =,
    NEGATOR = <>,
    MERGES,
    RESTRICT = eqsel,
    JOIN = eqjoinsel
);


ALTER OPERATOR public.= (seg, seg) OWNER TO postgres;

--
-- TOC entry 5749 (class 2617 OID 86358)
-- Dependencies: 2097 2859 11
-- Name: =>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR => (
    PROCEDURE = tconvert,
    LEFTARG = text,
    RIGHTARG = text
);


ALTER OPERATOR public.=> (text, text) OWNER TO postgres;

--
-- TOC entry 5584 (class 2617 OID 86153)
-- Dependencies: 1419 2816 2816 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = cube_gt,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (cube, cube) OWNER TO postgres;

--
-- TOC entry 5545 (class 2617 OID 86156)
-- Dependencies: 1752 2823 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5554 (class 2617 OID 86159)
-- Dependencies: 1763 2823 2867 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5548 (class 2617 OID 86162)
-- Dependencies: 1754 2867 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5560 (class 2617 OID 86165)
-- Dependencies: 1769 2823 2890 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5551 (class 2617 OID 86168)
-- Dependencies: 1756 2890 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5565 (class 2617 OID 86171)
-- Dependencies: 1775 2823 2900 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5557 (class 2617 OID 86174)
-- Dependencies: 1758 2900 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5571 (class 2617 OID 86177)
-- Dependencies: 1760 2823 2863 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5562 (class 2617 OID 86180)
-- Dependencies: 1753 2863 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5577 (class 2617 OID 86183)
-- Dependencies: 1766 2823 2884 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5568 (class 2617 OID 86186)
-- Dependencies: 1755 2884 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5582 (class 2617 OID 86189)
-- Dependencies: 1772 2823 2894 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5574 (class 2617 OID 86192)
-- Dependencies: 1757 2894 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5579 (class 2617 OID 86195)
-- Dependencies: 1778 2823 2932 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5688 (class 2617 OID 86198)
-- Dependencies: 1759 2932 2823 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5632 (class 2617 OID 86201)
-- Dependencies: 1765 2867 2867 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5597 (class 2617 OID 86204)
-- Dependencies: 1762 2867 2863 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5591 (class 2617 OID 86207)
-- Dependencies: 1764 2863 2867 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5594 (class 2617 OID 86210)
-- Dependencies: 1761 2863 2863 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5600 (class 2617 OID 86213)
-- Dependencies: 1771 2890 2890 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5609 (class 2617 OID 86216)
-- Dependencies: 1768 2890 2884 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5603 (class 2617 OID 86219)
-- Dependencies: 1770 2884 2890 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5606 (class 2617 OID 86222)
-- Dependencies: 1767 2884 2884 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5612 (class 2617 OID 86225)
-- Dependencies: 1777 2900 2900 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5621 (class 2617 OID 86228)
-- Dependencies: 1774 2900 2894 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5615 (class 2617 OID 86231)
-- Dependencies: 1776 2894 2900 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5618 (class 2617 OID 86234)
-- Dependencies: 1773 2894 2894 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (issn, issn) OWNER TO postgres;

--
-- TOC entry 5624 (class 2617 OID 86237)
-- Dependencies: 1779 2932 2932 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = isngt,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (upc, upc) OWNER TO postgres;

--
-- TOC entry 5627 (class 2617 OID 86240)
-- Dependencies: 1894 2882 2882 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = ltree_gt,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.> (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5630 (class 2617 OID 86243)
-- Dependencies: 2055 2922 2922 11
-- Name: >; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR > (
    PROCEDURE = seg_gt,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = <,
    NEGATOR = <=,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.> (seg, seg) OWNER TO postgres;

--
-- TOC entry 5586 (class 2617 OID 86154)
-- Dependencies: 1418 2816 2816 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = cube_ge,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (cube, cube) OWNER TO postgres;

--
-- TOC entry 5544 (class 2617 OID 86157)
-- Dependencies: 1474 2823 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, ean13) OWNER TO postgres;

--
-- TOC entry 5553 (class 2617 OID 86160)
-- Dependencies: 1726 2867 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = isbn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, isbn13) OWNER TO postgres;

--
-- TOC entry 5547 (class 2617 OID 86163)
-- Dependencies: 1735 2823 2867 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn13,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn13, ean13) OWNER TO postgres;

--
-- TOC entry 5559 (class 2617 OID 86166)
-- Dependencies: 1728 2890 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = ismn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, ismn13) OWNER TO postgres;

--
-- TOC entry 5550 (class 2617 OID 86169)
-- Dependencies: 1741 2823 2890 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn13,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn13, ean13) OWNER TO postgres;

--
-- TOC entry 5564 (class 2617 OID 86172)
-- Dependencies: 1730 2900 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = issn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, issn13) OWNER TO postgres;

--
-- TOC entry 5556 (class 2617 OID 86175)
-- Dependencies: 1747 2823 2900 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn13,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn13, ean13) OWNER TO postgres;

--
-- TOC entry 5570 (class 2617 OID 86178)
-- Dependencies: 1492 2863 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = isbn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, isbn) OWNER TO postgres;

--
-- TOC entry 5539 (class 2617 OID 86181)
-- Dependencies: 1732 2823 2863 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn, ean13) OWNER TO postgres;

--
-- TOC entry 5576 (class 2617 OID 86184)
-- Dependencies: 1727 2884 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = ismn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, ismn) OWNER TO postgres;

--
-- TOC entry 5567 (class 2617 OID 86187)
-- Dependencies: 1738 2823 2884 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn, ean13) OWNER TO postgres;

--
-- TOC entry 5581 (class 2617 OID 86190)
-- Dependencies: 1729 2894 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = issn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, issn) OWNER TO postgres;

--
-- TOC entry 5573 (class 2617 OID 86193)
-- Dependencies: 1744 2823 2894 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn, ean13) OWNER TO postgres;

--
-- TOC entry 5587 (class 2617 OID 86196)
-- Dependencies: 1731 2932 2823 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ean13,
    RIGHTARG = upc,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ean13, upc) OWNER TO postgres;

--
-- TOC entry 5637 (class 2617 OID 86199)
-- Dependencies: 1750 2823 2932 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = upc,
    RIGHTARG = ean13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (upc, ean13) OWNER TO postgres;

--
-- TOC entry 5588 (class 2617 OID 86202)
-- Dependencies: 1737 2867 2867 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn13,
    RIGHTARG = isbn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn13, isbn13) OWNER TO postgres;

--
-- TOC entry 5596 (class 2617 OID 86205)
-- Dependencies: 1736 2863 2867 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn13,
    RIGHTARG = isbn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn13, isbn) OWNER TO postgres;

--
-- TOC entry 5590 (class 2617 OID 86208)
-- Dependencies: 1734 2867 2863 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn,
    RIGHTARG = isbn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn, isbn13) OWNER TO postgres;

--
-- TOC entry 5593 (class 2617 OID 86211)
-- Dependencies: 1733 2863 2863 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = isbn,
    RIGHTARG = isbn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (isbn, isbn) OWNER TO postgres;

--
-- TOC entry 5599 (class 2617 OID 86214)
-- Dependencies: 1743 2890 2890 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn13,
    RIGHTARG = ismn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn13, ismn13) OWNER TO postgres;

--
-- TOC entry 5608 (class 2617 OID 86217)
-- Dependencies: 1742 2884 2890 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn13,
    RIGHTARG = ismn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn13, ismn) OWNER TO postgres;

--
-- TOC entry 5602 (class 2617 OID 86220)
-- Dependencies: 1740 2890 2884 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn,
    RIGHTARG = ismn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn, ismn13) OWNER TO postgres;

--
-- TOC entry 5605 (class 2617 OID 86223)
-- Dependencies: 1739 2884 2884 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = ismn,
    RIGHTARG = ismn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (ismn, ismn) OWNER TO postgres;

--
-- TOC entry 5611 (class 2617 OID 86226)
-- Dependencies: 1749 2900 2900 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn13,
    RIGHTARG = issn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn13, issn13) OWNER TO postgres;

--
-- TOC entry 5620 (class 2617 OID 86229)
-- Dependencies: 1748 2894 2900 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn13,
    RIGHTARG = issn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn13, issn) OWNER TO postgres;

--
-- TOC entry 5614 (class 2617 OID 86232)
-- Dependencies: 1746 2900 2894 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn,
    RIGHTARG = issn13,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn, issn13) OWNER TO postgres;

--
-- TOC entry 5617 (class 2617 OID 86235)
-- Dependencies: 1745 2894 2894 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = issn,
    RIGHTARG = issn,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (issn, issn) OWNER TO postgres;

--
-- TOC entry 5623 (class 2617 OID 86238)
-- Dependencies: 1751 2932 2932 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = isnge,
    LEFTARG = upc,
    RIGHTARG = upc,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (upc, upc) OWNER TO postgres;

--
-- TOC entry 5626 (class 2617 OID 86241)
-- Dependencies: 1893 2882 2882 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = ltree_ge,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.>= (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5629 (class 2617 OID 86244)
-- Dependencies: 2054 2922 2922 11
-- Name: >=; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >= (
    PROCEDURE = seg_ge,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = <=,
    NEGATOR = <,
    RESTRICT = scalargtsel,
    JOIN = scalargtjoinsel
);


ALTER OPERATOR public.>= (seg, seg) OWNER TO postgres;

--
-- TOC entry 5634 (class 2617 OID 86246)
-- Dependencies: 2064 2922 2922 11
-- Name: >>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR >> (
    PROCEDURE = seg_right,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = <<,
    RESTRICT = positionsel,
    JOIN = positionjoinsel
);


ALTER OPERATOR public.>> (seg, seg) OWNER TO postgres;

--
-- TOC entry 5750 (class 2617 OID 86359)
-- Dependencies: 1469 2859 11
-- Name: ?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ? (
    PROCEDURE = exist,
    LEFTARG = hstore,
    RIGHTARG = text,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.? (hstore, text) OWNER TO postgres;

--
-- TOC entry 5752 (class 2617 OID 86360)
-- Dependencies: 1882 2882 2907 11
-- Name: ?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ? (
    PROCEDURE = lt_q_rregex,
    LEFTARG = lquery[],
    RIGHTARG = ltree,
    COMMUTATOR = ?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.? (lquery[], ltree) OWNER TO postgres;

--
-- TOC entry 5751 (class 2617 OID 86361)
-- Dependencies: 1881 2907 2882 11
-- Name: ?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ? (
    PROCEDURE = lt_q_regex,
    LEFTARG = ltree,
    RIGHTARG = lquery[],
    COMMUTATOR = ?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.? (ltree, lquery[]) OWNER TO postgres;

--
-- TOC entry 5755 (class 2617 OID 86362)
-- Dependencies: 1261 2888 2907 11
-- Name: ?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ? (
    PROCEDURE = _lt_q_rregex,
    LEFTARG = lquery[],
    RIGHTARG = ltree[],
    COMMUTATOR = ?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.? (lquery[], ltree[]) OWNER TO postgres;

--
-- TOC entry 5753 (class 2617 OID 86363)
-- Dependencies: 1260 2907 2888 11
-- Name: ?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ? (
    PROCEDURE = _lt_q_regex,
    LEFTARG = ltree[],
    RIGHTARG = lquery[],
    COMMUTATOR = ?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.? (ltree[], lquery[]) OWNER TO postgres;

--
-- TOC entry 5756 (class 2617 OID 86364)
-- Dependencies: 1268 2882 2882 2888 11
-- Name: ?<@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ?<@ (
    PROCEDURE = _ltree_extract_risparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree
);


ALTER OPERATOR public.?<@ (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5757 (class 2617 OID 86365)
-- Dependencies: 1278 2882 2915 2888 11
-- Name: ?@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ?@ (
    PROCEDURE = _ltxtq_extract_exec,
    LEFTARG = ltree[],
    RIGHTARG = ltxtquery
);


ALTER OPERATOR public.?@ (ltree[], ltxtquery) OWNER TO postgres;

--
-- TOC entry 5758 (class 2617 OID 86366)
-- Dependencies: 1267 2882 2882 2888 11
-- Name: ?@>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ?@> (
    PROCEDURE = _ltree_extract_isparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree
);


ALTER OPERATOR public.?@> (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5759 (class 2617 OID 86367)
-- Dependencies: 1262 2882 2905 2888 11
-- Name: ?~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ?~ (
    PROCEDURE = _ltq_extract_regex,
    LEFTARG = ltree[],
    RIGHTARG = lquery
);


ALTER OPERATOR public.?~ (ltree[], lquery) OWNER TO postgres;

--
-- TOC entry 5761 (class 2617 OID 86369)
-- Dependencies: 1415 2816 2816 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = cube_contains,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (cube, cube) OWNER TO postgres;

--
-- TOC entry 5763 (class 2617 OID 86371)
-- Dependencies: 1677 2859 2859 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = hs_contains,
    LEFTARG = hstore,
    RIGHTARG = hstore,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (hstore, hstore) OWNER TO postgres;

--
-- TOC entry 5747 (class 2617 OID 86373)
-- Dependencies: 1254 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = _int_contains,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5765 (class 2617 OID 86374)
-- Dependencies: 1907 2882 2915 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = ltxtq_rexec,
    LEFTARG = ltxtquery,
    RIGHTARG = ltree,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (ltxtquery, ltree) OWNER TO postgres;

--
-- TOC entry 5754 (class 2617 OID 86375)
-- Dependencies: 1906 2915 2882 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = ltxtq_exec,
    LEFTARG = ltree,
    RIGHTARG = ltxtquery,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (ltree, ltxtquery) OWNER TO postgres;

--
-- TOC entry 5768 (class 2617 OID 86376)
-- Dependencies: 1279 2888 2915 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = _ltxtq_rexec,
    LEFTARG = ltxtquery,
    RIGHTARG = ltree[],
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (ltxtquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 5767 (class 2617 OID 86377)
-- Dependencies: 1277 2915 2888 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = _ltxtq_exec,
    LEFTARG = ltree[],
    RIGHTARG = ltxtquery,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (ltree[], ltxtquery) OWNER TO postgres;

--
-- TOC entry 5770 (class 2617 OID 86379)
-- Dependencies: 2052 2922 2922 11
-- Name: @; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @ (
    PROCEDURE = seg_contains,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@ (seg, seg) OWNER TO postgres;

--
-- TOC entry 5690 (class 2617 OID 86343)
-- Dependencies: 1415 2816 2816 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = cube_contains,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (cube, cube) OWNER TO postgres;

--
-- TOC entry 5733 (class 2617 OID 86345)
-- Dependencies: 1677 2859 2859 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = hs_contains,
    LEFTARG = hstore,
    RIGHTARG = hstore,
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (hstore, hstore) OWNER TO postgres;

--
-- TOC entry 5735 (class 2617 OID 86347)
-- Dependencies: 1254 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = _int_contains,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5737 (class 2617 OID 86349)
-- Dependencies: 1905 1895 2882 2882 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = ltree_isparent,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = <@,
    RESTRICT = ltreeparentsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5771 (class 2617 OID 86351)
-- Dependencies: 1269 2882 2888 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = _ltree_isparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree,
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5772 (class 2617 OID 86353)
-- Dependencies: 1273 2888 2882 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = _ltree_r_risparent,
    LEFTARG = ltree,
    RIGHTARG = ltree[],
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 5774 (class 2617 OID 86355)
-- Dependencies: 2052 2922 2922 11
-- Name: @>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @> (
    PROCEDURE = seg_contains,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = <@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@> (seg, seg) OWNER TO postgres;

--
-- TOC entry 5742 (class 2617 OID 86381)
-- Dependencies: 1335 2898 11
-- Name: @@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR @@ (
    PROCEDURE = boolop,
    LEFTARG = integer[],
    RIGHTARG = query_int,
    COMMUTATOR = ~~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.@@ (integer[], query_int) OWNER TO postgres;

--
-- TOC entry 5766 (class 2617 OID 86383)
-- Dependencies: 1901 2882 2882 11
-- Name: ^<@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^<@ (
    PROCEDURE = ltree_risparent,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = ^@>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^<@ (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5773 (class 2617 OID 86385)
-- Dependencies: 1272 2888 2882 11
-- Name: ^<@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^<@ (
    PROCEDURE = _ltree_r_isparent,
    LEFTARG = ltree,
    RIGHTARG = ltree[],
    COMMUTATOR = ^@>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^<@ (ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 5775 (class 2617 OID 86387)
-- Dependencies: 1274 2882 2888 11
-- Name: ^<@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^<@ (
    PROCEDURE = _ltree_risparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree,
    COMMUTATOR = ^@>,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^<@ (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5779 (class 2617 OID 86388)
-- Dependencies: 1882 2882 2907 11
-- Name: ^?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^? (
    PROCEDURE = lt_q_rregex,
    LEFTARG = lquery[],
    RIGHTARG = ltree,
    COMMUTATOR = ^?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^? (lquery[], ltree) OWNER TO postgres;

--
-- TOC entry 5777 (class 2617 OID 86389)
-- Dependencies: 1881 2907 2882 11
-- Name: ^?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^? (
    PROCEDURE = lt_q_regex,
    LEFTARG = ltree,
    RIGHTARG = lquery[],
    COMMUTATOR = ^?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^? (ltree, lquery[]) OWNER TO postgres;

--
-- TOC entry 5783 (class 2617 OID 86390)
-- Dependencies: 1261 2888 2907 11
-- Name: ^?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^? (
    PROCEDURE = _lt_q_rregex,
    LEFTARG = lquery[],
    RIGHTARG = ltree[],
    COMMUTATOR = ^?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^? (lquery[], ltree[]) OWNER TO postgres;

--
-- TOC entry 5781 (class 2617 OID 86391)
-- Dependencies: 1260 2907 2888 11
-- Name: ^?; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^? (
    PROCEDURE = _lt_q_regex,
    LEFTARG = ltree[],
    RIGHTARG = lquery[],
    COMMUTATOR = ^?,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^? (ltree[], lquery[]) OWNER TO postgres;

--
-- TOC entry 5782 (class 2617 OID 86392)
-- Dependencies: 1907 2882 2915 11
-- Name: ^@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@ (
    PROCEDURE = ltxtq_rexec,
    LEFTARG = ltxtquery,
    RIGHTARG = ltree,
    COMMUTATOR = ^@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@ (ltxtquery, ltree) OWNER TO postgres;

--
-- TOC entry 5778 (class 2617 OID 86393)
-- Dependencies: 1906 2915 2882 11
-- Name: ^@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@ (
    PROCEDURE = ltxtq_exec,
    LEFTARG = ltree,
    RIGHTARG = ltxtquery,
    COMMUTATOR = ^@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@ (ltree, ltxtquery) OWNER TO postgres;

--
-- TOC entry 5776 (class 2617 OID 86394)
-- Dependencies: 1279 2888 2915 11
-- Name: ^@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@ (
    PROCEDURE = _ltxtq_rexec,
    LEFTARG = ltxtquery,
    RIGHTARG = ltree[],
    COMMUTATOR = ^@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@ (ltxtquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 5780 (class 2617 OID 86395)
-- Dependencies: 1277 2915 2888 11
-- Name: ^@; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@ (
    PROCEDURE = _ltxtq_exec,
    LEFTARG = ltree[],
    RIGHTARG = ltxtquery,
    COMMUTATOR = ^@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@ (ltree[], ltxtquery) OWNER TO postgres;

--
-- TOC entry 5786 (class 2617 OID 86382)
-- Dependencies: 1895 2882 2882 11
-- Name: ^@>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@> (
    PROCEDURE = ltree_isparent,
    LEFTARG = ltree,
    RIGHTARG = ltree,
    COMMUTATOR = ^<@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@> (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5784 (class 2617 OID 86384)
-- Dependencies: 1269 2882 2888 11
-- Name: ^@>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@> (
    PROCEDURE = _ltree_isparent,
    LEFTARG = ltree[],
    RIGHTARG = ltree,
    COMMUTATOR = ^<@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@> (ltree[], ltree) OWNER TO postgres;

--
-- TOC entry 5764 (class 2617 OID 86386)
-- Dependencies: 1273 2888 2882 11
-- Name: ^@>; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^@> (
    PROCEDURE = _ltree_r_risparent,
    LEFTARG = ltree,
    RIGHTARG = ltree[],
    COMMUTATOR = ^<@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^@> (ltree, ltree[]) OWNER TO postgres;

--
-- TOC entry 5785 (class 2617 OID 86396)
-- Dependencies: 1884 2882 2905 11
-- Name: ^~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^~ (
    PROCEDURE = ltq_rregex,
    LEFTARG = lquery,
    RIGHTARG = ltree,
    COMMUTATOR = ^~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^~ (lquery, ltree) OWNER TO postgres;

--
-- TOC entry 5787 (class 2617 OID 86397)
-- Dependencies: 1883 2905 2882 11
-- Name: ^~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^~ (
    PROCEDURE = ltq_regex,
    LEFTARG = ltree,
    RIGHTARG = lquery,
    COMMUTATOR = ^~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^~ (ltree, lquery) OWNER TO postgres;

--
-- TOC entry 5788 (class 2617 OID 86398)
-- Dependencies: 1264 2888 2905 11
-- Name: ^~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^~ (
    PROCEDURE = _ltq_rregex,
    LEFTARG = lquery,
    RIGHTARG = ltree[],
    COMMUTATOR = ^~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^~ (lquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 5789 (class 2617 OID 86399)
-- Dependencies: 1263 2905 2888 11
-- Name: ^~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ^~ (
    PROCEDURE = _ltq_regex,
    LEFTARG = ltree[],
    RIGHTARG = lquery,
    COMMUTATOR = ^~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.^~ (ltree[], lquery) OWNER TO postgres;

--
-- TOC entry 5790 (class 2617 OID 86400)
-- Dependencies: 1685 11
-- Name: |; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR | (
    PROCEDURE = intset_union_elem,
    LEFTARG = integer[],
    RIGHTARG = integer
);


ALTER OPERATOR public.| (integer[], integer) OWNER TO postgres;

--
-- TOC entry 5791 (class 2617 OID 86401)
-- Dependencies: 1259 11
-- Name: |; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR | (
    PROCEDURE = _int_union,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = |
);


ALTER OPERATOR public.| (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5792 (class 2617 OID 86402)
-- Dependencies: 1675 2859 2859 2859 11
-- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR || (
    PROCEDURE = hs_concat,
    LEFTARG = hstore,
    RIGHTARG = hstore
);


ALTER OPERATOR public.|| (hstore, hstore) OWNER TO postgres;

--
-- TOC entry 5793 (class 2617 OID 86403)
-- Dependencies: 1886 2882 2882 2882 11
-- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR || (
    PROCEDURE = ltree_addltree,
    LEFTARG = ltree,
    RIGHTARG = ltree
);


ALTER OPERATOR public.|| (ltree, ltree) OWNER TO postgres;

--
-- TOC entry 5794 (class 2617 OID 86404)
-- Dependencies: 1887 2882 2882 11
-- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR || (
    PROCEDURE = ltree_addtext,
    LEFTARG = ltree,
    RIGHTARG = text
);


ALTER OPERATOR public.|| (ltree, text) OWNER TO postgres;

--
-- TOC entry 5795 (class 2617 OID 86405)
-- Dependencies: 1903 2882 2882 11
-- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR || (
    PROCEDURE = ltree_textadd,
    LEFTARG = text,
    RIGHTARG = ltree
);


ALTER OPERATOR public.|| (text, ltree) OWNER TO postgres;

--
-- TOC entry 5760 (class 2617 OID 86368)
-- Dependencies: 1414 2816 2816 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = cube_contained,
    LEFTARG = cube,
    RIGHTARG = cube,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (cube, cube) OWNER TO postgres;

--
-- TOC entry 5762 (class 2617 OID 86370)
-- Dependencies: 1676 2859 2859 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = hs_contained,
    LEFTARG = hstore,
    RIGHTARG = hstore,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (hstore, hstore) OWNER TO postgres;

--
-- TOC entry 5745 (class 2617 OID 86372)
-- Dependencies: 1253 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = _int_contained,
    LEFTARG = integer[],
    RIGHTARG = integer[],
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (integer[], integer[]) OWNER TO postgres;

--
-- TOC entry 5769 (class 2617 OID 86378)
-- Dependencies: 2051 2922 2922 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = seg_contained,
    LEFTARG = seg,
    RIGHTARG = seg,
    COMMUTATOR = @,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (seg, seg) OWNER TO postgres;

--
-- TOC entry 5797 (class 2617 OID 86406)
-- Dependencies: 1884 2882 2905 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = ltq_rregex,
    LEFTARG = lquery,
    RIGHTARG = ltree,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (lquery, ltree) OWNER TO postgres;

--
-- TOC entry 5796 (class 2617 OID 86407)
-- Dependencies: 1883 2905 2882 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = ltq_regex,
    LEFTARG = ltree,
    RIGHTARG = lquery,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (ltree, lquery) OWNER TO postgres;

--
-- TOC entry 5799 (class 2617 OID 86408)
-- Dependencies: 1264 2888 2905 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = _ltq_rregex,
    LEFTARG = lquery,
    RIGHTARG = ltree[],
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (lquery, ltree[]) OWNER TO postgres;

--
-- TOC entry 5798 (class 2617 OID 86409)
-- Dependencies: 1263 2905 2888 11
-- Name: ~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~ (
    PROCEDURE = _ltq_regex,
    LEFTARG = ltree[],
    RIGHTARG = lquery,
    COMMUTATOR = ~,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~ (ltree[], lquery) OWNER TO postgres;

--
-- TOC entry 5740 (class 2617 OID 86380)
-- Dependencies: 1984 2898 11
-- Name: ~~; Type: OPERATOR; Schema: public; Owner: postgres
--

CREATE OPERATOR ~~ (
    PROCEDURE = rboolop,
    LEFTARG = query_int,
    RIGHTARG = integer[],
    COMMUTATOR = @@,
    RESTRICT = contsel,
    JOIN = contjoinsel
);


ALTER OPERATOR public.~~ (query_int, integer[]) OWNER TO postgres;

--
-- TOC entry 6035 (class 2753 OID 86410)
-- Dependencies: 11
-- Name: cube_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY cube_ops USING btree;


ALTER OPERATOR FAMILY public.cube_ops USING btree OWNER TO sijyp;

--
-- TOC entry 5913 (class 2616 OID 86411)
-- Dependencies: 2816 6035 11
-- Name: cube_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS cube_ops
    DEFAULT FOR TYPE cube USING btree AS
    OPERATOR 1 <(cube,cube) ,
    OPERATOR 2 <=(cube,cube) ,
    OPERATOR 3 =(cube,cube) ,
    OPERATOR 4 >=(cube,cube) ,
    OPERATOR 5 >(cube,cube) ,
    FUNCTION 1 cube_cmp(cube,cube);


ALTER OPERATOR CLASS public.cube_ops USING btree OWNER TO postgres;

--
-- TOC entry 6036 (class 2753 OID 86418)
-- Dependencies: 11
-- Name: isn_ops; Type: OPERATOR FAMILY; Schema: public; Owner: postgres
--

CREATE OPERATOR FAMILY isn_ops USING btree;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
    OPERATOR 1 <(ismn,ismn13) ,
    OPERATOR 1 <(ean13,isbn13) ,
    OPERATOR 1 <(upc,ean13) ,
    OPERATOR 1 <(issn13,issn) ,
    OPERATOR 1 <(issn13,ean13) ,
    OPERATOR 1 <(ean13,issn13) ,
    OPERATOR 1 <(ean13,isbn) ,
    OPERATOR 1 <(ean13,ismn) ,
    OPERATOR 1 <(ean13,issn) ,
    OPERATOR 1 <(ean13,upc) ,
    OPERATOR 1 <(isbn13,ean13) ,
    OPERATOR 1 <(ean13,ismn13) ,
    OPERATOR 1 <(isbn13,isbn) ,
    OPERATOR 1 <(issn,issn13) ,
    OPERATOR 1 <(issn,ean13) ,
    OPERATOR 1 <(isbn,ean13) ,
    OPERATOR 1 <(isbn,isbn13) ,
    OPERATOR 1 <(ismn13,ean13) ,
    OPERATOR 1 <(ismn13,ismn) ,
    OPERATOR 1 <(ismn,ean13) ,
    OPERATOR 2 <=(issn,ean13) ,
    OPERATOR 2 <=(upc,ean13) ,
    OPERATOR 2 <=(issn,issn13) ,
    OPERATOR 2 <=(issn13,issn) ,
    OPERATOR 2 <=(issn13,ean13) ,
    OPERATOR 2 <=(ismn,ismn13) ,
    OPERATOR 2 <=(ismn,ean13) ,
    OPERATOR 2 <=(ismn13,ismn) ,
    OPERATOR 2 <=(ismn13,ean13) ,
    OPERATOR 2 <=(isbn,isbn13) ,
    OPERATOR 2 <=(isbn,ean13) ,
    OPERATOR 2 <=(isbn13,isbn) ,
    OPERATOR 2 <=(isbn13,ean13) ,
    OPERATOR 2 <=(ean13,upc) ,
    OPERATOR 2 <=(ean13,issn) ,
    OPERATOR 2 <=(ean13,ismn) ,
    OPERATOR 2 <=(ean13,isbn) ,
    OPERATOR 2 <=(ean13,issn13) ,
    OPERATOR 2 <=(ean13,ismn13) ,
    OPERATOR 2 <=(ean13,isbn13) ,
    OPERATOR 3 =(isbn13,ean13) ,
    OPERATOR 3 =(upc,ean13) ,
    OPERATOR 3 =(ismn13,ismn) ,
    OPERATOR 3 =(ean13,issn13) ,
    OPERATOR 3 =(issn,ean13) ,
    OPERATOR 3 =(ean13,isbn) ,
    OPERATOR 3 =(ean13,ismn) ,
    OPERATOR 3 =(ean13,issn) ,
    OPERATOR 3 =(ean13,upc) ,
    OPERATOR 3 =(isbn,isbn13) ,
    OPERATOR 3 =(isbn,ean13) ,
    OPERATOR 3 =(issn13,ean13) ,
    OPERATOR 3 =(issn,issn13) ,
    OPERATOR 3 =(ean13,isbn13) ,
    OPERATOR 3 =(ismn,ean13) ,
    OPERATOR 3 =(ismn,ismn13) ,
    OPERATOR 3 =(ean13,ismn13) ,
    OPERATOR 3 =(issn13,issn) ,
    OPERATOR 3 =(ismn13,ean13) ,
    OPERATOR 3 =(isbn13,isbn) ,
    OPERATOR 4 >=(isbn,isbn13) ,
    OPERATOR 4 >=(issn,ean13) ,
    OPERATOR 4 >=(issn,issn13) ,
    OPERATOR 4 >=(issn13,ean13) ,
    OPERATOR 4 >=(issn13,issn) ,
    OPERATOR 4 >=(isbn,ean13) ,
    OPERATOR 4 >=(isbn13,isbn) ,
    OPERATOR 4 >=(isbn13,ean13) ,
    OPERATOR 4 >=(upc,ean13) ,
    OPERATOR 4 >=(ean13,upc) ,
    OPERATOR 4 >=(ean13,issn) ,
    OPERATOR 4 >=(ean13,ismn) ,
    OPERATOR 4 >=(ean13,isbn) ,
    OPERATOR 4 >=(ean13,issn13) ,
    OPERATOR 4 >=(ean13,ismn13) ,
    OPERATOR 4 >=(ean13,isbn13) ,
    OPERATOR 4 >=(ismn,ismn13) ,
    OPERATOR 4 >=(ismn,ean13) ,
    OPERATOR 4 >=(ismn13,ismn) ,
    OPERATOR 4 >=(ismn13,ean13) ,
    OPERATOR 5 >(ean13,ismn) ,
    OPERATOR 5 >(ean13,issn) ,
    OPERATOR 5 >(ean13,upc) ,
    OPERATOR 5 >(upc,ean13) ,
    OPERATOR 5 >(isbn13,ean13) ,
    OPERATOR 5 >(ismn,ismn13) ,
    OPERATOR 5 >(ismn,ean13) ,
    OPERATOR 5 >(ismn13,ean13) ,
    OPERATOR 5 >(isbn,isbn13) ,
    OPERATOR 5 >(ean13,issn13) ,
    OPERATOR 5 >(ean13,ismn13) ,
    OPERATOR 5 >(ean13,isbn13) ,
    OPERATOR 5 >(isbn13,isbn) ,
    OPERATOR 5 >(issn13,issn) ,
    OPERATOR 5 >(issn13,ean13) ,
    OPERATOR 5 >(issn,issn13) ,
    OPERATOR 5 >(issn,ean13) ,
    OPERATOR 5 >(isbn,ean13) ,
    OPERATOR 5 >(ismn13,ismn) ,
    OPERATOR 5 >(ean13,isbn) ,
    FUNCTION 1 (upc, ean13) btupccmp(upc,ean13) ,
    FUNCTION 1 (issn, issn13) btissncmp(issn,issn13) ,
    FUNCTION 1 (issn, ean13) btissncmp(issn,ean13) ,
    FUNCTION 1 (issn13, issn) btissn13cmp(issn13,issn) ,
    FUNCTION 1 (issn13, ean13) btissn13cmp(issn13,ean13) ,
    FUNCTION 1 (ismn, ismn13) btismncmp(ismn,ismn13) ,
    FUNCTION 1 (ismn, ean13) btismncmp(ismn,ean13) ,
    FUNCTION 1 (ismn13, ismn) btismn13cmp(ismn13,ismn) ,
    FUNCTION 1 (ismn13, ean13) btismn13cmp(ismn13,ean13) ,
    FUNCTION 1 (isbn, isbn13) btisbncmp(isbn,isbn13) ,
    FUNCTION 1 (isbn, ean13) btisbncmp(isbn,ean13) ,
    FUNCTION 1 (isbn13, isbn) btisbn13cmp(isbn13,isbn) ,
    FUNCTION 1 (isbn13, ean13) btisbn13cmp(isbn13,ean13) ,
    FUNCTION 1 (ean13, upc) btean13cmp(ean13,upc) ,
    FUNCTION 1 (ean13, issn) btean13cmp(ean13,issn) ,
    FUNCTION 1 (ean13, ismn) btean13cmp(ean13,ismn) ,
    FUNCTION 1 (ean13, isbn) btean13cmp(ean13,isbn) ,
    FUNCTION 1 (ean13, issn13) btean13cmp(ean13,issn13) ,
    FUNCTION 1 (ean13, ismn13) btean13cmp(ean13,ismn13) ,
    FUNCTION 1 (ean13, isbn13) btean13cmp(ean13,isbn13);


ALTER OPERATOR FAMILY public.isn_ops USING btree OWNER TO postgres;

--
-- TOC entry 5914 (class 2616 OID 86539)
-- Dependencies: 2823 6036 11
-- Name: ean13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ean13_ops
    DEFAULT FOR TYPE ean13 USING btree FAMILY isn_ops AS
    OPERATOR 1 <(ean13,ean13) ,
    OPERATOR 2 <=(ean13,ean13) ,
    OPERATOR 3 =(ean13,ean13) ,
    OPERATOR 4 >=(ean13,ean13) ,
    OPERATOR 5 >(ean13,ean13) ,
    FUNCTION 1 btean13cmp(ean13,ean13);


ALTER OPERATOR CLASS public.ean13_ops USING btree OWNER TO postgres;

--
-- TOC entry 6037 (class 2753 OID 86546)
-- Dependencies: 11
-- Name: isn_ops; Type: OPERATOR FAMILY; Schema: public; Owner: postgres
--

CREATE OPERATOR FAMILY isn_ops USING hash;
ALTER OPERATOR FAMILY isn_ops USING hash ADD
    OPERATOR 1 =(ean13,isbn13) ,
    OPERATOR 1 =(ean13,ismn13) ,
    OPERATOR 1 =(ean13,issn13) ,
    OPERATOR 1 =(ean13,isbn) ,
    OPERATOR 1 =(ean13,ismn) ,
    OPERATOR 1 =(ean13,issn) ,
    OPERATOR 1 =(ean13,upc) ,
    OPERATOR 1 =(isbn13,ean13) ,
    OPERATOR 1 =(isbn13,isbn) ,
    OPERATOR 1 =(isbn,ean13) ,
    OPERATOR 1 =(isbn,isbn13) ,
    OPERATOR 1 =(ismn13,ean13) ,
    OPERATOR 1 =(ismn13,ismn) ,
    OPERATOR 1 =(ismn,ean13) ,
    OPERATOR 1 =(ismn,ismn13) ,
    OPERATOR 1 =(issn13,ean13) ,
    OPERATOR 1 =(issn13,issn) ,
    OPERATOR 1 =(issn,ean13) ,
    OPERATOR 1 =(issn,issn13) ,
    OPERATOR 1 =(upc,ean13);


ALTER OPERATOR FAMILY public.isn_ops USING hash OWNER TO postgres;

--
-- TOC entry 5915 (class 2616 OID 86567)
-- Dependencies: 2823 6037 11
-- Name: ean13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ean13_ops
    DEFAULT FOR TYPE ean13 USING hash FAMILY isn_ops AS
    OPERATOR 1 =(ean13,ean13) ,
    FUNCTION 1 hashean13(ean13);


ALTER OPERATOR CLASS public.ean13_ops USING hash OWNER TO postgres;

--
-- TOC entry 6038 (class 2753 OID 86570)
-- Dependencies: 11
-- Name: gin__int_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gin__int_ops USING gin;


ALTER OPERATOR FAMILY public.gin__int_ops USING gin OWNER TO sijyp;

--
-- TOC entry 5916 (class 2616 OID 86571)
-- Dependencies: 6038 11
-- Name: gin__int_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gin__int_ops
    FOR TYPE integer[] USING gin AS
    STORAGE integer ,
    OPERATOR 3 &&(integer[],integer[]) ,
    OPERATOR 6 =(anyarray,anyarray) ,
    OPERATOR 7 @>(integer[],integer[]) ,
    OPERATOR 8 <@(integer[],integer[]) ,
    OPERATOR 13 @(integer[],integer[]) ,
    OPERATOR 14 ~(integer[],integer[]) ,
    OPERATOR 20 @@(integer[],query_int) ,
    FUNCTION 1 btint4cmp(integer,integer) ,
    FUNCTION 2 ginarrayextract(anyarray,internal) ,
    FUNCTION 3 ginint4_queryextract(internal,internal,smallint) ,
    FUNCTION 4 ginint4_consistent(internal,smallint,internal);


ALTER OPERATOR CLASS public.gin__int_ops USING gin OWNER TO postgres;

--
-- TOC entry 6039 (class 2753 OID 86583)
-- Dependencies: 11
-- Name: gin_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gin_hstore_ops USING gin;


ALTER OPERATOR FAMILY public.gin_hstore_ops USING gin OWNER TO sijyp;

--
-- TOC entry 5917 (class 2616 OID 86584)
-- Dependencies: 2859 6039 11
-- Name: gin_hstore_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gin_hstore_ops
    DEFAULT FOR TYPE hstore USING gin AS
    STORAGE text ,
    OPERATOR 7 @>(hstore,hstore) ,
    OPERATOR 9 ?(hstore,text) ,
    FUNCTION 1 bttextcmp(text,text) ,
    FUNCTION 2 gin_extract_hstore(internal,internal) ,
    FUNCTION 3 gin_extract_hstore_query(internal,internal,smallint) ,
    FUNCTION 4 gin_consistent_hstore(internal,smallint,internal);


ALTER OPERATOR CLASS public.gin_hstore_ops USING gin OWNER TO postgres;

--
-- TOC entry 6040 (class 2753 OID 86591)
-- Dependencies: 11
-- Name: gin_trgm_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gin_trgm_ops USING gin;


ALTER OPERATOR FAMILY public.gin_trgm_ops USING gin OWNER TO sijyp;

--
-- TOC entry 5918 (class 2616 OID 86592)
-- Dependencies: 6040 11
-- Name: gin_trgm_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gin_trgm_ops
    FOR TYPE text USING gin AS
    STORAGE integer ,
    OPERATOR 1 %(text,text) ,
    FUNCTION 1 btint4cmp(integer,integer) ,
    FUNCTION 2 gin_extract_trgm(text,internal) ,
    FUNCTION 3 gin_extract_trgm(text,internal,internal) ,
    FUNCTION 4 gin_trgm_consistent(internal,internal,text);


ALTER OPERATOR CLASS public.gin_trgm_ops USING gin OWNER TO postgres;

--
-- TOC entry 6041 (class 2753 OID 86598)
-- Dependencies: 11
-- Name: gist__int_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist__int_ops USING gist;


ALTER OPERATOR FAMILY public.gist__int_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5919 (class 2616 OID 86599)
-- Dependencies: 6041 11
-- Name: gist__int_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist__int_ops
    DEFAULT FOR TYPE integer[] USING gist AS
    OPERATOR 3 &&(integer[],integer[]) ,
    OPERATOR 6 =(anyarray,anyarray) ,
    OPERATOR 7 @>(integer[],integer[]) ,
    OPERATOR 8 <@(integer[],integer[]) ,
    OPERATOR 13 @(integer[],integer[]) ,
    OPERATOR 14 ~(integer[],integer[]) ,
    OPERATOR 20 @@(integer[],query_int) ,
    FUNCTION 1 g_int_consistent(internal,integer[],integer) ,
    FUNCTION 2 g_int_union(internal,internal) ,
    FUNCTION 3 g_int_compress(internal) ,
    FUNCTION 4 g_int_decompress(internal) ,
    FUNCTION 5 g_int_penalty(internal,internal,internal) ,
    FUNCTION 6 g_int_picksplit(internal,internal) ,
    FUNCTION 7 g_int_same(integer[],integer[],internal);


ALTER OPERATOR CLASS public.gist__int_ops USING gist OWNER TO postgres;

--
-- TOC entry 6042 (class 2753 OID 86614)
-- Dependencies: 11
-- Name: gist__intbig_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist__intbig_ops USING gist;


ALTER OPERATOR FAMILY public.gist__intbig_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5920 (class 2616 OID 86615)
-- Dependencies: 2857 6042 11
-- Name: gist__intbig_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist__intbig_ops
    FOR TYPE integer[] USING gist AS
    STORAGE intbig_gkey ,
    OPERATOR 3 &&(integer[],integer[]) ,
    OPERATOR 6 =(anyarray,anyarray) ,
    OPERATOR 7 @>(integer[],integer[]) ,
    OPERATOR 8 <@(integer[],integer[]) ,
    OPERATOR 13 @(integer[],integer[]) ,
    OPERATOR 14 ~(integer[],integer[]) ,
    OPERATOR 20 @@(integer[],query_int) ,
    FUNCTION 1 g_intbig_consistent(internal,internal,integer) ,
    FUNCTION 2 g_intbig_union(internal,internal) ,
    FUNCTION 3 g_intbig_compress(internal) ,
    FUNCTION 4 g_intbig_decompress(internal) ,
    FUNCTION 5 g_intbig_penalty(internal,internal,internal) ,
    FUNCTION 6 g_intbig_picksplit(internal,internal) ,
    FUNCTION 7 g_intbig_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist__intbig_ops USING gist OWNER TO postgres;

--
-- TOC entry 6043 (class 2753 OID 86630)
-- Dependencies: 11
-- Name: gist__ltree_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist__ltree_ops USING gist;


ALTER OPERATOR FAMILY public.gist__ltree_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5921 (class 2616 OID 86631)
-- Dependencies: 2911 2888 6043 11
-- Name: gist__ltree_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist__ltree_ops
    DEFAULT FOR TYPE ltree[] USING gist AS
    STORAGE ltree_gist ,
    OPERATOR 10 <@(ltree[],ltree) ,
    OPERATOR 11 @>(ltree,ltree[]) ,
    OPERATOR 12 ~(ltree[],lquery) ,
    OPERATOR 13 ~(lquery,ltree[]) ,
    OPERATOR 14 @(ltree[],ltxtquery) ,
    OPERATOR 15 @(ltxtquery,ltree[]) ,
    OPERATOR 16 ?(ltree[],lquery[]) ,
    OPERATOR 17 ?(lquery[],ltree[]) ,
    FUNCTION 1 _ltree_consistent(internal,internal,smallint) ,
    FUNCTION 2 _ltree_union(internal,internal) ,
    FUNCTION 3 _ltree_compress(internal) ,
    FUNCTION 4 ltree_decompress(internal) ,
    FUNCTION 5 _ltree_penalty(internal,internal,internal) ,
    FUNCTION 6 _ltree_picksplit(internal,internal) ,
    FUNCTION 7 _ltree_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist__ltree_ops USING gist OWNER TO postgres;

--
-- TOC entry 6044 (class 2753 OID 86647)
-- Dependencies: 11
-- Name: gist_bit_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_bit_ops USING gist;


ALTER OPERATOR FAMILY public.gist_bit_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5922 (class 2616 OID 86648)
-- Dependencies: 2849 6044 11
-- Name: gist_bit_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_bit_ops
    DEFAULT FOR TYPE bit USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(bit,bit) ,
    OPERATOR 2 <=(bit,bit) ,
    OPERATOR 3 =(bit,bit) ,
    OPERATOR 4 >=(bit,bit) ,
    OPERATOR 5 >(bit,bit) ,
    FUNCTION 1 gbt_bit_consistent(internal,bit,smallint) ,
    FUNCTION 2 gbt_bit_union(bytea,internal) ,
    FUNCTION 3 gbt_bit_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_bit_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_bit_picksplit(internal,internal) ,
    FUNCTION 7 gbt_bit_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_bit_ops USING gist OWNER TO postgres;

--
-- TOC entry 6045 (class 2753 OID 86661)
-- Dependencies: 11
-- Name: gist_bpchar_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_bpchar_ops USING gist;


ALTER OPERATOR FAMILY public.gist_bpchar_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5923 (class 2616 OID 86662)
-- Dependencies: 2849 6045 11
-- Name: gist_bpchar_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_bpchar_ops
    DEFAULT FOR TYPE character USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(character,character) ,
    OPERATOR 2 <=(character,character) ,
    OPERATOR 3 =(character,character) ,
    OPERATOR 4 >=(character,character) ,
    OPERATOR 5 >(character,character) ,
    FUNCTION 1 gbt_bpchar_consistent(internal,character,smallint) ,
    FUNCTION 2 gbt_text_union(bytea,internal) ,
    FUNCTION 3 gbt_bpchar_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_text_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_text_picksplit(internal,internal) ,
    FUNCTION 7 gbt_text_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_bpchar_ops USING gist OWNER TO postgres;

--
-- TOC entry 6046 (class 2753 OID 86675)
-- Dependencies: 11
-- Name: gist_bytea_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_bytea_ops USING gist;


ALTER OPERATOR FAMILY public.gist_bytea_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5924 (class 2616 OID 86676)
-- Dependencies: 2849 6046 11
-- Name: gist_bytea_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_bytea_ops
    DEFAULT FOR TYPE bytea USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(bytea,bytea) ,
    OPERATOR 2 <=(bytea,bytea) ,
    OPERATOR 3 =(bytea,bytea) ,
    OPERATOR 4 >=(bytea,bytea) ,
    OPERATOR 5 >(bytea,bytea) ,
    FUNCTION 1 gbt_bytea_consistent(internal,bytea,smallint) ,
    FUNCTION 2 gbt_bytea_union(bytea,internal) ,
    FUNCTION 3 gbt_bytea_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_bytea_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_bytea_picksplit(internal,internal) ,
    FUNCTION 7 gbt_bytea_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_bytea_ops USING gist OWNER TO postgres;

--
-- TOC entry 6047 (class 2753 OID 86689)
-- Dependencies: 11
-- Name: gist_cash_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_cash_ops USING gist;


ALTER OPERATOR FAMILY public.gist_cash_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5925 (class 2616 OID 86690)
-- Dependencies: 2833 6047 11
-- Name: gist_cash_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_cash_ops
    DEFAULT FOR TYPE money USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(money,money) ,
    OPERATOR 2 <=(money,money) ,
    OPERATOR 3 =(money,money) ,
    OPERATOR 4 >=(money,money) ,
    OPERATOR 5 >(money,money) ,
    FUNCTION 1 gbt_cash_consistent(internal,money,smallint) ,
    FUNCTION 2 gbt_cash_union(bytea,internal) ,
    FUNCTION 3 gbt_cash_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_cash_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_cash_picksplit(internal,internal) ,
    FUNCTION 7 gbt_cash_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_cash_ops USING gist OWNER TO postgres;

--
-- TOC entry 6048 (class 2753 OID 86703)
-- Dependencies: 11
-- Name: gist_cidr_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_cidr_ops USING gist;


ALTER OPERATOR FAMILY public.gist_cidr_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5926 (class 2616 OID 86704)
-- Dependencies: 2833 6048 11
-- Name: gist_cidr_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_cidr_ops
    DEFAULT FOR TYPE cidr USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(inet,inet) ,
    OPERATOR 2 <=(inet,inet) ,
    OPERATOR 3 =(inet,inet) ,
    OPERATOR 4 >=(inet,inet) ,
    OPERATOR 5 >(inet,inet) ,
    FUNCTION 1 gbt_inet_consistent(internal,inet,smallint) ,
    FUNCTION 2 gbt_inet_union(bytea,internal) ,
    FUNCTION 3 gbt_inet_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_inet_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_inet_picksplit(internal,internal) ,
    FUNCTION 7 gbt_inet_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_cidr_ops USING gist OWNER TO postgres;

--
-- TOC entry 6049 (class 2753 OID 86717)
-- Dependencies: 11
-- Name: gist_cube_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_cube_ops USING gist;


ALTER OPERATOR FAMILY public.gist_cube_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5927 (class 2616 OID 86718)
-- Dependencies: 2816 6049 11
-- Name: gist_cube_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_cube_ops
    DEFAULT FOR TYPE cube USING gist AS
    OPERATOR 3 &&(cube,cube) ,
    OPERATOR 6 =(cube,cube) ,
    OPERATOR 7 @>(cube,cube) ,
    OPERATOR 8 <@(cube,cube) ,
    OPERATOR 13 @(cube,cube) ,
    OPERATOR 14 ~(cube,cube) ,
    FUNCTION 1 g_cube_consistent(internal,cube,integer) ,
    FUNCTION 2 g_cube_union(internal,internal) ,
    FUNCTION 3 g_cube_compress(internal) ,
    FUNCTION 4 g_cube_decompress(internal) ,
    FUNCTION 5 g_cube_penalty(internal,internal,internal) ,
    FUNCTION 6 g_cube_picksplit(internal,internal) ,
    FUNCTION 7 g_cube_same(cube,cube,internal);


ALTER OPERATOR CLASS public.gist_cube_ops USING gist OWNER TO postgres;

--
-- TOC entry 6050 (class 2753 OID 86732)
-- Dependencies: 11
-- Name: gist_date_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_date_ops USING gist;


ALTER OPERATOR FAMILY public.gist_date_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5928 (class 2616 OID 86733)
-- Dependencies: 2843 6050 11
-- Name: gist_date_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_date_ops
    DEFAULT FOR TYPE date USING gist AS
    STORAGE gbtreekey8 ,
    OPERATOR 1 <(date,date) ,
    OPERATOR 2 <=(date,date) ,
    OPERATOR 3 =(date,date) ,
    OPERATOR 4 >=(date,date) ,
    OPERATOR 5 >(date,date) ,
    FUNCTION 1 gbt_date_consistent(internal,date,smallint) ,
    FUNCTION 2 gbt_date_union(bytea,internal) ,
    FUNCTION 3 gbt_date_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_date_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_date_picksplit(internal,internal) ,
    FUNCTION 7 gbt_date_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_date_ops USING gist OWNER TO postgres;

--
-- TOC entry 6051 (class 2753 OID 86746)
-- Dependencies: 11
-- Name: gist_float4_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_float4_ops USING gist;


ALTER OPERATOR FAMILY public.gist_float4_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5929 (class 2616 OID 86747)
-- Dependencies: 2843 6051 11
-- Name: gist_float4_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_float4_ops
    DEFAULT FOR TYPE real USING gist AS
    STORAGE gbtreekey8 ,
    OPERATOR 1 <(real,real) ,
    OPERATOR 2 <=(real,real) ,
    OPERATOR 3 =(real,real) ,
    OPERATOR 4 >=(real,real) ,
    OPERATOR 5 >(real,real) ,
    FUNCTION 1 gbt_float4_consistent(internal,real,smallint) ,
    FUNCTION 2 gbt_float4_union(bytea,internal) ,
    FUNCTION 3 gbt_float4_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_float4_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_float4_picksplit(internal,internal) ,
    FUNCTION 7 gbt_float4_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_float4_ops USING gist OWNER TO postgres;

--
-- TOC entry 6052 (class 2753 OID 86760)
-- Dependencies: 11
-- Name: gist_float8_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_float8_ops USING gist;


ALTER OPERATOR FAMILY public.gist_float8_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5930 (class 2616 OID 86761)
-- Dependencies: 2833 6052 11
-- Name: gist_float8_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_float8_ops
    DEFAULT FOR TYPE double precision USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(double precision,double precision) ,
    OPERATOR 2 <=(double precision,double precision) ,
    OPERATOR 3 =(double precision,double precision) ,
    OPERATOR 4 >=(double precision,double precision) ,
    OPERATOR 5 >(double precision,double precision) ,
    FUNCTION 1 gbt_float8_consistent(internal,double precision,smallint) ,
    FUNCTION 2 gbt_float8_union(bytea,internal) ,
    FUNCTION 3 gbt_float8_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_float8_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_float8_picksplit(internal,internal) ,
    FUNCTION 7 gbt_float8_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_float8_ops USING gist OWNER TO postgres;

--
-- TOC entry 6053 (class 2753 OID 86774)
-- Dependencies: 11
-- Name: gist_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_hstore_ops USING gist;


ALTER OPERATOR FAMILY public.gist_hstore_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5931 (class 2616 OID 86775)
-- Dependencies: 2851 2859 6053 11
-- Name: gist_hstore_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_hstore_ops
    DEFAULT FOR TYPE hstore USING gist AS
    STORAGE ghstore ,
    OPERATOR 7 @>(hstore,hstore) ,
    OPERATOR 9 ?(hstore,text) ,
    OPERATOR 13 @(hstore,hstore) ,
    FUNCTION 1 ghstore_consistent(internal,internal,integer) ,
    FUNCTION 2 ghstore_union(internal,internal) ,
    FUNCTION 3 ghstore_compress(internal) ,
    FUNCTION 4 ghstore_decompress(internal) ,
    FUNCTION 5 ghstore_penalty(internal,internal,internal) ,
    FUNCTION 6 ghstore_picksplit(internal,internal) ,
    FUNCTION 7 ghstore_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_hstore_ops USING gist OWNER TO postgres;

--
-- TOC entry 6054 (class 2753 OID 86786)
-- Dependencies: 11
-- Name: gist_inet_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_inet_ops USING gist;


ALTER OPERATOR FAMILY public.gist_inet_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5932 (class 2616 OID 86787)
-- Dependencies: 2833 6054 11
-- Name: gist_inet_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_inet_ops
    DEFAULT FOR TYPE inet USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(inet,inet) ,
    OPERATOR 2 <=(inet,inet) ,
    OPERATOR 3 =(inet,inet) ,
    OPERATOR 4 >=(inet,inet) ,
    OPERATOR 5 >(inet,inet) ,
    FUNCTION 1 gbt_inet_consistent(internal,inet,smallint) ,
    FUNCTION 2 gbt_inet_union(bytea,internal) ,
    FUNCTION 3 gbt_inet_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_inet_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_inet_picksplit(internal,internal) ,
    FUNCTION 7 gbt_inet_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_inet_ops USING gist OWNER TO postgres;

--
-- TOC entry 6055 (class 2753 OID 86800)
-- Dependencies: 11
-- Name: gist_int2_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_int2_ops USING gist;


ALTER OPERATOR FAMILY public.gist_int2_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5933 (class 2616 OID 86801)
-- Dependencies: 2837 6055 11
-- Name: gist_int2_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_int2_ops
    DEFAULT FOR TYPE smallint USING gist AS
    STORAGE gbtreekey4 ,
    OPERATOR 1 <(smallint,smallint) ,
    OPERATOR 2 <=(smallint,smallint) ,
    OPERATOR 3 =(smallint,smallint) ,
    OPERATOR 4 >=(smallint,smallint) ,
    OPERATOR 5 >(smallint,smallint) ,
    FUNCTION 1 gbt_int2_consistent(internal,smallint,smallint) ,
    FUNCTION 2 gbt_int2_union(bytea,internal) ,
    FUNCTION 3 gbt_int2_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_int2_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_int2_picksplit(internal,internal) ,
    FUNCTION 7 gbt_int2_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_int2_ops USING gist OWNER TO postgres;

--
-- TOC entry 6056 (class 2753 OID 86814)
-- Dependencies: 11
-- Name: gist_int4_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_int4_ops USING gist;


ALTER OPERATOR FAMILY public.gist_int4_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5934 (class 2616 OID 86815)
-- Dependencies: 2843 6056 11
-- Name: gist_int4_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_int4_ops
    DEFAULT FOR TYPE integer USING gist AS
    STORAGE gbtreekey8 ,
    OPERATOR 1 <(integer,integer) ,
    OPERATOR 2 <=(integer,integer) ,
    OPERATOR 3 =(integer,integer) ,
    OPERATOR 4 >=(integer,integer) ,
    OPERATOR 5 >(integer,integer) ,
    FUNCTION 1 gbt_int4_consistent(internal,integer,smallint) ,
    FUNCTION 2 gbt_int4_union(bytea,internal) ,
    FUNCTION 3 gbt_int4_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_int4_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_int4_picksplit(internal,internal) ,
    FUNCTION 7 gbt_int4_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_int4_ops USING gist OWNER TO postgres;

--
-- TOC entry 6057 (class 2753 OID 86828)
-- Dependencies: 11
-- Name: gist_int8_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_int8_ops USING gist;


ALTER OPERATOR FAMILY public.gist_int8_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5935 (class 2616 OID 86829)
-- Dependencies: 2833 6057 11
-- Name: gist_int8_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_int8_ops
    DEFAULT FOR TYPE bigint USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(bigint,bigint) ,
    OPERATOR 2 <=(bigint,bigint) ,
    OPERATOR 3 =(bigint,bigint) ,
    OPERATOR 4 >=(bigint,bigint) ,
    OPERATOR 5 >(bigint,bigint) ,
    FUNCTION 1 gbt_int8_consistent(internal,bigint,smallint) ,
    FUNCTION 2 gbt_int8_union(bytea,internal) ,
    FUNCTION 3 gbt_int8_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_int8_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_int8_picksplit(internal,internal) ,
    FUNCTION 7 gbt_int8_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_int8_ops USING gist OWNER TO postgres;

--
-- TOC entry 6058 (class 2753 OID 86842)
-- Dependencies: 11
-- Name: gist_interval_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_interval_ops USING gist;


ALTER OPERATOR FAMILY public.gist_interval_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5936 (class 2616 OID 86843)
-- Dependencies: 2808 6058 11
-- Name: gist_interval_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_interval_ops
    DEFAULT FOR TYPE interval USING gist AS
    STORAGE gbtreekey32 ,
    OPERATOR 1 <(interval,interval) ,
    OPERATOR 2 <=(interval,interval) ,
    OPERATOR 3 =(interval,interval) ,
    OPERATOR 4 >=(interval,interval) ,
    OPERATOR 5 >(interval,interval) ,
    FUNCTION 1 gbt_intv_consistent(internal,interval,smallint) ,
    FUNCTION 2 gbt_intv_union(bytea,internal) ,
    FUNCTION 3 gbt_intv_compress(internal) ,
    FUNCTION 4 gbt_intv_decompress(internal) ,
    FUNCTION 5 gbt_intv_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_intv_picksplit(internal,internal) ,
    FUNCTION 7 gbt_intv_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_interval_ops USING gist OWNER TO postgres;

--
-- TOC entry 6059 (class 2753 OID 86856)
-- Dependencies: 11
-- Name: gist_ltree_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_ltree_ops USING gist;


ALTER OPERATOR FAMILY public.gist_ltree_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5937 (class 2616 OID 86857)
-- Dependencies: 2911 2882 6059 11
-- Name: gist_ltree_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_ltree_ops
    DEFAULT FOR TYPE ltree USING gist AS
    STORAGE ltree_gist ,
    OPERATOR 1 <(ltree,ltree) ,
    OPERATOR 2 <=(ltree,ltree) ,
    OPERATOR 3 =(ltree,ltree) ,
    OPERATOR 4 >=(ltree,ltree) ,
    OPERATOR 5 >(ltree,ltree) ,
    OPERATOR 10 @>(ltree,ltree) ,
    OPERATOR 11 <@(ltree,ltree) ,
    OPERATOR 12 ~(ltree,lquery) ,
    OPERATOR 13 ~(lquery,ltree) ,
    OPERATOR 14 @(ltree,ltxtquery) ,
    OPERATOR 15 @(ltxtquery,ltree) ,
    OPERATOR 16 ?(ltree,lquery[]) ,
    OPERATOR 17 ?(lquery[],ltree) ,
    FUNCTION 1 ltree_consistent(internal,internal,smallint) ,
    FUNCTION 2 ltree_union(internal,internal) ,
    FUNCTION 3 ltree_compress(internal) ,
    FUNCTION 4 ltree_decompress(internal) ,
    FUNCTION 5 ltree_penalty(internal,internal,internal) ,
    FUNCTION 6 ltree_picksplit(internal,internal) ,
    FUNCTION 7 ltree_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_ltree_ops USING gist OWNER TO postgres;

--
-- TOC entry 6060 (class 2753 OID 86878)
-- Dependencies: 11
-- Name: gist_macaddr_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_macaddr_ops USING gist;


ALTER OPERATOR FAMILY public.gist_macaddr_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5938 (class 2616 OID 86879)
-- Dependencies: 2833 6060 11
-- Name: gist_macaddr_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_macaddr_ops
    DEFAULT FOR TYPE macaddr USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(macaddr,macaddr) ,
    OPERATOR 2 <=(macaddr,macaddr) ,
    OPERATOR 3 =(macaddr,macaddr) ,
    OPERATOR 4 >=(macaddr,macaddr) ,
    OPERATOR 5 >(macaddr,macaddr) ,
    FUNCTION 1 gbt_macad_consistent(internal,macaddr,smallint) ,
    FUNCTION 2 gbt_macad_union(bytea,internal) ,
    FUNCTION 3 gbt_macad_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_macad_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_macad_picksplit(internal,internal) ,
    FUNCTION 7 gbt_macad_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_macaddr_ops USING gist OWNER TO postgres;

--
-- TOC entry 6061 (class 2753 OID 86892)
-- Dependencies: 11
-- Name: gist_numeric_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_numeric_ops USING gist;


ALTER OPERATOR FAMILY public.gist_numeric_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5939 (class 2616 OID 86893)
-- Dependencies: 2849 6061 11
-- Name: gist_numeric_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_numeric_ops
    DEFAULT FOR TYPE numeric USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(numeric,numeric) ,
    OPERATOR 2 <=(numeric,numeric) ,
    OPERATOR 3 =(numeric,numeric) ,
    OPERATOR 4 >=(numeric,numeric) ,
    OPERATOR 5 >(numeric,numeric) ,
    FUNCTION 1 gbt_numeric_consistent(internal,numeric,smallint) ,
    FUNCTION 2 gbt_numeric_union(bytea,internal) ,
    FUNCTION 3 gbt_numeric_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_numeric_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_numeric_picksplit(internal,internal) ,
    FUNCTION 7 gbt_numeric_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_numeric_ops USING gist OWNER TO postgres;

--
-- TOC entry 6062 (class 2753 OID 86906)
-- Dependencies: 11
-- Name: gist_oid_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_oid_ops USING gist;


ALTER OPERATOR FAMILY public.gist_oid_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5940 (class 2616 OID 86907)
-- Dependencies: 2843 6062 11
-- Name: gist_oid_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_oid_ops
    DEFAULT FOR TYPE oid USING gist AS
    STORAGE gbtreekey8 ,
    OPERATOR 1 <(oid,oid) ,
    OPERATOR 2 <=(oid,oid) ,
    OPERATOR 3 =(oid,oid) ,
    OPERATOR 4 >=(oid,oid) ,
    OPERATOR 5 >(oid,oid) ,
    FUNCTION 1 gbt_oid_consistent(internal,oid,smallint) ,
    FUNCTION 2 gbt_oid_union(bytea,internal) ,
    FUNCTION 3 gbt_oid_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_oid_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_oid_picksplit(internal,internal) ,
    FUNCTION 7 gbt_oid_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_oid_ops USING gist OWNER TO postgres;

--
-- TOC entry 6063 (class 2753 OID 86920)
-- Dependencies: 11
-- Name: gist_seg_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_seg_ops USING gist;


ALTER OPERATOR FAMILY public.gist_seg_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5941 (class 2616 OID 86921)
-- Dependencies: 2922 6063 11
-- Name: gist_seg_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_seg_ops
    DEFAULT FOR TYPE seg USING gist AS
    OPERATOR 1 <<(seg,seg) ,
    OPERATOR 2 &<(seg,seg) ,
    OPERATOR 3 &&(seg,seg) ,
    OPERATOR 4 &>(seg,seg) ,
    OPERATOR 5 >>(seg,seg) ,
    OPERATOR 6 =(seg,seg) ,
    OPERATOR 7 @>(seg,seg) ,
    OPERATOR 8 <@(seg,seg) ,
    OPERATOR 13 @(seg,seg) ,
    OPERATOR 14 ~(seg,seg) ,
    FUNCTION 1 gseg_consistent(internal,seg,integer) ,
    FUNCTION 2 gseg_union(internal,internal) ,
    FUNCTION 3 gseg_compress(internal) ,
    FUNCTION 4 gseg_decompress(internal) ,
    FUNCTION 5 gseg_penalty(internal,internal,internal) ,
    FUNCTION 6 gseg_picksplit(internal,internal) ,
    FUNCTION 7 gseg_same(seg,seg,internal);


ALTER OPERATOR CLASS public.gist_seg_ops USING gist OWNER TO postgres;

--
-- TOC entry 6064 (class 2753 OID 86939)
-- Dependencies: 11
-- Name: gist_text_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_text_ops USING gist;


ALTER OPERATOR FAMILY public.gist_text_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5942 (class 2616 OID 86940)
-- Dependencies: 2849 6064 11
-- Name: gist_text_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_text_ops
    DEFAULT FOR TYPE text USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(text,text) ,
    OPERATOR 2 <=(text,text) ,
    OPERATOR 3 =(text,text) ,
    OPERATOR 4 >=(text,text) ,
    OPERATOR 5 >(text,text) ,
    FUNCTION 1 gbt_text_consistent(internal,text,smallint) ,
    FUNCTION 2 gbt_text_union(bytea,internal) ,
    FUNCTION 3 gbt_text_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_text_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_text_picksplit(internal,internal) ,
    FUNCTION 7 gbt_text_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_text_ops USING gist OWNER TO postgres;

--
-- TOC entry 6065 (class 2753 OID 86953)
-- Dependencies: 11
-- Name: gist_time_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_time_ops USING gist;


ALTER OPERATOR FAMILY public.gist_time_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5943 (class 2616 OID 86954)
-- Dependencies: 2833 6065 11
-- Name: gist_time_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_time_ops
    DEFAULT FOR TYPE time without time zone USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(time without time zone,time without time zone) ,
    OPERATOR 2 <=(time without time zone,time without time zone) ,
    OPERATOR 3 =(time without time zone,time without time zone) ,
    OPERATOR 4 >=(time without time zone,time without time zone) ,
    OPERATOR 5 >(time without time zone,time without time zone) ,
    FUNCTION 1 gbt_time_consistent(internal,time without time zone,smallint) ,
    FUNCTION 2 gbt_time_union(bytea,internal) ,
    FUNCTION 3 gbt_time_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_time_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_time_picksplit(internal,internal) ,
    FUNCTION 7 gbt_time_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_time_ops USING gist OWNER TO postgres;

--
-- TOC entry 6066 (class 2753 OID 86967)
-- Dependencies: 11
-- Name: gist_timestamp_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_timestamp_ops USING gist;


ALTER OPERATOR FAMILY public.gist_timestamp_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5944 (class 2616 OID 86968)
-- Dependencies: 2833 6066 11
-- Name: gist_timestamp_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_timestamp_ops
    DEFAULT FOR TYPE timestamp without time zone USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(timestamp without time zone,timestamp without time zone) ,
    OPERATOR 2 <=(timestamp without time zone,timestamp without time zone) ,
    OPERATOR 3 =(timestamp without time zone,timestamp without time zone) ,
    OPERATOR 4 >=(timestamp without time zone,timestamp without time zone) ,
    OPERATOR 5 >(timestamp without time zone,timestamp without time zone) ,
    FUNCTION 1 gbt_ts_consistent(internal,timestamp without time zone,smallint) ,
    FUNCTION 2 gbt_ts_union(bytea,internal) ,
    FUNCTION 3 gbt_ts_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_ts_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_ts_picksplit(internal,internal) ,
    FUNCTION 7 gbt_ts_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_timestamp_ops USING gist OWNER TO postgres;

--
-- TOC entry 6067 (class 2753 OID 86981)
-- Dependencies: 11
-- Name: gist_timestamptz_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_timestamptz_ops USING gist;


ALTER OPERATOR FAMILY public.gist_timestamptz_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5945 (class 2616 OID 86982)
-- Dependencies: 2833 6067 11
-- Name: gist_timestamptz_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_timestamptz_ops
    DEFAULT FOR TYPE timestamp with time zone USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(timestamp with time zone,timestamp with time zone) ,
    OPERATOR 2 <=(timestamp with time zone,timestamp with time zone) ,
    OPERATOR 3 =(timestamp with time zone,timestamp with time zone) ,
    OPERATOR 4 >=(timestamp with time zone,timestamp with time zone) ,
    OPERATOR 5 >(timestamp with time zone,timestamp with time zone) ,
    FUNCTION 1 gbt_tstz_consistent(internal,timestamp with time zone,smallint) ,
    FUNCTION 2 gbt_ts_union(bytea,internal) ,
    FUNCTION 3 gbt_tstz_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_ts_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_ts_picksplit(internal,internal) ,
    FUNCTION 7 gbt_ts_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_timestamptz_ops USING gist OWNER TO postgres;

--
-- TOC entry 6068 (class 2753 OID 86995)
-- Dependencies: 11
-- Name: gist_timetz_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_timetz_ops USING gist;


ALTER OPERATOR FAMILY public.gist_timetz_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5946 (class 2616 OID 86996)
-- Dependencies: 2833 6068 11
-- Name: gist_timetz_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_timetz_ops
    DEFAULT FOR TYPE time with time zone USING gist AS
    STORAGE gbtreekey16 ,
    OPERATOR 1 <(time with time zone,time with time zone) ,
    OPERATOR 2 <=(time with time zone,time with time zone) ,
    OPERATOR 3 =(time with time zone,time with time zone) ,
    OPERATOR 4 >=(time with time zone,time with time zone) ,
    OPERATOR 5 >(time with time zone,time with time zone) ,
    FUNCTION 1 gbt_timetz_consistent(internal,time with time zone,smallint) ,
    FUNCTION 2 gbt_time_union(bytea,internal) ,
    FUNCTION 3 gbt_timetz_compress(internal) ,
    FUNCTION 4 gbt_decompress(internal) ,
    FUNCTION 5 gbt_time_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_time_picksplit(internal,internal) ,
    FUNCTION 7 gbt_time_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_timetz_ops USING gist OWNER TO postgres;

--
-- TOC entry 6069 (class 2753 OID 87009)
-- Dependencies: 11
-- Name: gist_trgm_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_trgm_ops USING gist;


ALTER OPERATOR FAMILY public.gist_trgm_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5947 (class 2616 OID 87010)
-- Dependencies: 2841 6069 11
-- Name: gist_trgm_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_trgm_ops
    FOR TYPE text USING gist AS
    STORAGE gtrgm ,
    OPERATOR 1 %(text,text) ,
    FUNCTION 1 gtrgm_consistent(gtrgm,internal,integer) ,
    FUNCTION 2 gtrgm_union(bytea,internal) ,
    FUNCTION 3 gtrgm_compress(internal) ,
    FUNCTION 4 gtrgm_decompress(internal) ,
    FUNCTION 5 gtrgm_penalty(internal,internal,internal) ,
    FUNCTION 6 gtrgm_picksplit(internal,internal) ,
    FUNCTION 7 gtrgm_same(gtrgm,gtrgm,internal);


ALTER OPERATOR CLASS public.gist_trgm_ops USING gist OWNER TO postgres;

--
-- TOC entry 6070 (class 2753 OID 87019)
-- Dependencies: 11
-- Name: gist_vbit_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY gist_vbit_ops USING gist;


ALTER OPERATOR FAMILY public.gist_vbit_ops USING gist OWNER TO sijyp;

--
-- TOC entry 5948 (class 2616 OID 87020)
-- Dependencies: 2849 6070 11
-- Name: gist_vbit_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS gist_vbit_ops
    DEFAULT FOR TYPE bit varying USING gist AS
    STORAGE gbtreekey_var ,
    OPERATOR 1 <(bit varying,bit varying) ,
    OPERATOR 2 <=(bit varying,bit varying) ,
    OPERATOR 3 =(bit varying,bit varying) ,
    OPERATOR 4 >=(bit varying,bit varying) ,
    OPERATOR 5 >(bit varying,bit varying) ,
    FUNCTION 1 gbt_bit_consistent(internal,bit,smallint) ,
    FUNCTION 2 gbt_bit_union(bytea,internal) ,
    FUNCTION 3 gbt_bit_compress(internal) ,
    FUNCTION 4 gbt_var_decompress(internal) ,
    FUNCTION 5 gbt_bit_penalty(internal,internal,internal) ,
    FUNCTION 6 gbt_bit_picksplit(internal,internal) ,
    FUNCTION 7 gbt_bit_same(internal,internal,internal);


ALTER OPERATOR CLASS public.gist_vbit_ops USING gist OWNER TO postgres;

--
-- TOC entry 5949 (class 2616 OID 87033)
-- Dependencies: 2867 6036 11
-- Name: isbn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS isbn13_ops
    DEFAULT FOR TYPE isbn13 USING btree FAMILY isn_ops AS
    OPERATOR 1 <(isbn13,isbn13) ,
    OPERATOR 2 <=(isbn13,isbn13) ,
    OPERATOR 3 =(isbn13,isbn13) ,
    OPERATOR 4 >=(isbn13,isbn13) ,
    OPERATOR 5 >(isbn13,isbn13) ,
    FUNCTION 1 btisbn13cmp(isbn13,isbn13);


ALTER OPERATOR CLASS public.isbn13_ops USING btree OWNER TO postgres;

--
-- TOC entry 5950 (class 2616 OID 87040)
-- Dependencies: 2867 6037 11
-- Name: isbn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS isbn13_ops
    DEFAULT FOR TYPE isbn13 USING hash FAMILY isn_ops AS
    OPERATOR 1 =(isbn13,isbn13) ,
    FUNCTION 1 hashisbn13(isbn13);


ALTER OPERATOR CLASS public.isbn13_ops USING hash OWNER TO postgres;

--
-- TOC entry 5951 (class 2616 OID 87043)
-- Dependencies: 2863 6036 11
-- Name: isbn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS isbn_ops
    DEFAULT FOR TYPE isbn USING btree FAMILY isn_ops AS
    OPERATOR 1 <(isbn,isbn) ,
    OPERATOR 2 <=(isbn,isbn) ,
    OPERATOR 3 =(isbn,isbn) ,
    OPERATOR 4 >=(isbn,isbn) ,
    OPERATOR 5 >(isbn,isbn) ,
    FUNCTION 1 btisbncmp(isbn,isbn);


ALTER OPERATOR CLASS public.isbn_ops USING btree OWNER TO postgres;

--
-- TOC entry 5952 (class 2616 OID 87050)
-- Dependencies: 2863 6037 11
-- Name: isbn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS isbn_ops
    DEFAULT FOR TYPE isbn USING hash FAMILY isn_ops AS
    OPERATOR 1 =(isbn,isbn) ,
    FUNCTION 1 hashisbn(isbn);


ALTER OPERATOR CLASS public.isbn_ops USING hash OWNER TO postgres;

--
-- TOC entry 5953 (class 2616 OID 87053)
-- Dependencies: 2890 6036 11
-- Name: ismn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ismn13_ops
    DEFAULT FOR TYPE ismn13 USING btree FAMILY isn_ops AS
    OPERATOR 1 <(ismn13,ismn13) ,
    OPERATOR 2 <=(ismn13,ismn13) ,
    OPERATOR 3 =(ismn13,ismn13) ,
    OPERATOR 4 >=(ismn13,ismn13) ,
    OPERATOR 5 >(ismn13,ismn13) ,
    FUNCTION 1 btismn13cmp(ismn13,ismn13);


ALTER OPERATOR CLASS public.ismn13_ops USING btree OWNER TO postgres;

--
-- TOC entry 5954 (class 2616 OID 87060)
-- Dependencies: 2890 6037 11
-- Name: ismn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ismn13_ops
    DEFAULT FOR TYPE ismn13 USING hash FAMILY isn_ops AS
    OPERATOR 1 =(ismn13,ismn13) ,
    FUNCTION 1 hashismn13(ismn13);


ALTER OPERATOR CLASS public.ismn13_ops USING hash OWNER TO postgres;

--
-- TOC entry 5955 (class 2616 OID 87063)
-- Dependencies: 2884 6036 11
-- Name: ismn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ismn_ops
    DEFAULT FOR TYPE ismn USING btree FAMILY isn_ops AS
    OPERATOR 1 <(ismn,ismn) ,
    OPERATOR 2 <=(ismn,ismn) ,
    OPERATOR 3 =(ismn,ismn) ,
    OPERATOR 4 >=(ismn,ismn) ,
    OPERATOR 5 >(ismn,ismn) ,
    FUNCTION 1 btismncmp(ismn,ismn);


ALTER OPERATOR CLASS public.ismn_ops USING btree OWNER TO postgres;

--
-- TOC entry 5956 (class 2616 OID 87070)
-- Dependencies: 2884 6037 11
-- Name: ismn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ismn_ops
    DEFAULT FOR TYPE ismn USING hash FAMILY isn_ops AS
    OPERATOR 1 =(ismn,ismn) ,
    FUNCTION 1 hashismn(ismn);


ALTER OPERATOR CLASS public.ismn_ops USING hash OWNER TO postgres;

--
-- TOC entry 5957 (class 2616 OID 87073)
-- Dependencies: 2900 6036 11
-- Name: issn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS issn13_ops
    DEFAULT FOR TYPE issn13 USING btree FAMILY isn_ops AS
    OPERATOR 1 <(issn13,issn13) ,
    OPERATOR 2 <=(issn13,issn13) ,
    OPERATOR 3 =(issn13,issn13) ,
    OPERATOR 4 >=(issn13,issn13) ,
    OPERATOR 5 >(issn13,issn13) ,
    FUNCTION 1 btissn13cmp(issn13,issn13);


ALTER OPERATOR CLASS public.issn13_ops USING btree OWNER TO postgres;

--
-- TOC entry 5958 (class 2616 OID 87080)
-- Dependencies: 2900 6037 11
-- Name: issn13_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS issn13_ops
    DEFAULT FOR TYPE issn13 USING hash FAMILY isn_ops AS
    OPERATOR 1 =(issn13,issn13) ,
    FUNCTION 1 hashissn13(issn13);


ALTER OPERATOR CLASS public.issn13_ops USING hash OWNER TO postgres;

--
-- TOC entry 5959 (class 2616 OID 87083)
-- Dependencies: 2894 6036 11
-- Name: issn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS issn_ops
    DEFAULT FOR TYPE issn USING btree FAMILY isn_ops AS
    OPERATOR 1 <(issn,issn) ,
    OPERATOR 2 <=(issn,issn) ,
    OPERATOR 3 =(issn,issn) ,
    OPERATOR 4 >=(issn,issn) ,
    OPERATOR 5 >(issn,issn) ,
    FUNCTION 1 btissncmp(issn,issn);


ALTER OPERATOR CLASS public.issn_ops USING btree OWNER TO postgres;

--
-- TOC entry 5960 (class 2616 OID 87090)
-- Dependencies: 2894 6037 11
-- Name: issn_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS issn_ops
    DEFAULT FOR TYPE issn USING hash FAMILY isn_ops AS
    OPERATOR 1 =(issn,issn) ,
    FUNCTION 1 hashissn(issn);


ALTER OPERATOR CLASS public.issn_ops USING hash OWNER TO postgres;

--
-- TOC entry 6071 (class 2753 OID 87093)
-- Dependencies: 11
-- Name: ltree_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY ltree_ops USING btree;


ALTER OPERATOR FAMILY public.ltree_ops USING btree OWNER TO sijyp;

--
-- TOC entry 5961 (class 2616 OID 87094)
-- Dependencies: 2882 6071 11
-- Name: ltree_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS ltree_ops
    DEFAULT FOR TYPE ltree USING btree AS
    OPERATOR 1 <(ltree,ltree) ,
    OPERATOR 2 <=(ltree,ltree) ,
    OPERATOR 3 =(ltree,ltree) ,
    OPERATOR 4 >=(ltree,ltree) ,
    OPERATOR 5 >(ltree,ltree) ,
    FUNCTION 1 ltree_cmp(ltree,ltree);


ALTER OPERATOR CLASS public.ltree_ops USING btree OWNER TO postgres;

--
-- TOC entry 6072 (class 2753 OID 87101)
-- Dependencies: 11
-- Name: seg_ops; Type: OPERATOR FAMILY; Schema: public; Owner: sijyp
--

CREATE OPERATOR FAMILY seg_ops USING btree;


ALTER OPERATOR FAMILY public.seg_ops USING btree OWNER TO sijyp;

--
-- TOC entry 5962 (class 2616 OID 87102)
-- Dependencies: 2922 6072 11
-- Name: seg_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS seg_ops
    DEFAULT FOR TYPE seg USING btree AS
    OPERATOR 1 <(seg,seg) ,
    OPERATOR 2 <=(seg,seg) ,
    OPERATOR 3 =(seg,seg) ,
    OPERATOR 4 >=(seg,seg) ,
    OPERATOR 5 >(seg,seg) ,
    FUNCTION 1 seg_cmp(seg,seg);


ALTER OPERATOR CLASS public.seg_ops USING btree OWNER TO postgres;

--
-- TOC entry 5963 (class 2616 OID 87109)
-- Dependencies: 2932 6036 11
-- Name: upc_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS upc_ops
    DEFAULT FOR TYPE upc USING btree FAMILY isn_ops AS
    OPERATOR 1 <(upc,upc) ,
    OPERATOR 2 <=(upc,upc) ,
    OPERATOR 3 =(upc,upc) ,
    OPERATOR 4 >=(upc,upc) ,
    OPERATOR 5 >(upc,upc) ,
    FUNCTION 1 btupccmp(upc,upc);


ALTER OPERATOR CLASS public.upc_ops USING btree OWNER TO postgres;

--
-- TOC entry 5964 (class 2616 OID 87116)
-- Dependencies: 2932 6037 11
-- Name: upc_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
--

CREATE OPERATOR CLASS upc_ops
    DEFAULT FOR TYPE upc USING hash FAMILY isn_ops AS
    OPERATOR 1 =(upc,upc) ,
    FUNCTION 1 hashupc(upc);


ALTER OPERATOR CLASS public.upc_ops USING hash OWNER TO postgres;

--
-- TOC entry 6113 (class 3602 OID 96069)
-- Dependencies: 6096 6093 11
-- Name: es; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: sijyp
--

CREATE TEXT SEARCH CONFIGURATION es (
    PARSER = pg_catalog."default" );

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR asciiword WITH spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR word WITH unaccent, spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR numword WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR email WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR url WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR host WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR sfloat WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR version WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR hword_numpart WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR hword_part WITH unaccent, spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR hword_asciipart WITH spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR numhword WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR asciihword WITH spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR hword WITH unaccent, spanish_stem;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR url_path WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR file WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR "float" WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR "int" WITH simple;

ALTER TEXT SEARCH CONFIGURATION es
    ADD MAPPING FOR uint WITH simple;


ALTER TEXT SEARCH CONFIGURATION public.es OWNER TO sijyp;

--
-- TOC entry 330 (class 1259 OID 87119)
-- Dependencies: 11
-- Name: personajuridicacolectividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personajuridicacolectividad (
    idpersonajuridicacolectividad integer NOT NULL,
    idtipopersona integer NOT NULL,
    nombre character varying(50) NOT NULL,
    idtipodocumentoidentidad integer,
    numerodocumento character varying(20),
    fechaexpedicion date,
    idpaisexpedicion integer,
    iddepartamentoexpedicion integer,
    idmunicipioexpedicion integer,
    idtipoclasificacionpersonajuridica integer,
    idtiposubclasificacionpersonajuridica integer,
    fechaconstitucion date,
    idtipoestadopersona character varying(60) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15),
    observacion text
);


ALTER TABLE public.personajuridicacolectividad OWNER TO postgres;

--
-- TOC entry 9005 (class 0 OID 0)
-- Dependencies: 330
-- Name: TABLE personajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personajuridicacolectividad IS 'Persona Juridica o Colectividad.';


--
-- TOC entry 9006 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idpersonajuridicacolectividad IS 'Identificador de la persona juridica o colectividad.';


--
-- TOC entry 9007 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idtipopersona IS 'Tipo de persona.';


--
-- TOC entry 9008 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.nombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.nombre IS 'Nombre de la colectividad o Razon social de la persona juridica.';


--
-- TOC entry 9009 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idtipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idtipodocumentoidentidad IS 'Tipo de documento de indentidad.';


--
-- TOC entry 9010 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.numerodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.numerodocumento IS 'Numero de documnento de identidad.';


--
-- TOC entry 9011 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.fechaexpedicion IS 'Fecha de expedicion del documento de identidad.';


--
-- TOC entry 9012 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idpaisexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idpaisexpedicion IS 'Pais de expedicion documento.';


--
-- TOC entry 9013 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.iddepartamentoexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.iddepartamentoexpedicion IS 'Departamento de expedicion del documento.';


--
-- TOC entry 9014 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idmunicipioexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idmunicipioexpedicion IS 'Municipio de expedicion del documento.';


--
-- TOC entry 9015 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idtipoclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idtipoclasificacionpersonajuridica IS 'Tipo clasificacion.';


--
-- TOC entry 9016 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idtiposubclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idtiposubclasificacionpersonajuridica IS 'Subtipo de clasificacion.';


--
-- TOC entry 9017 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.fechaconstitucion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.fechaconstitucion IS 'Fecha de constitucion.';


--
-- TOC entry 9018 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.idtipoestadopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.idtipoestadopersona IS 'Tipo de estado persona.';


--
-- TOC entry 9019 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 9020 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.ip IS 'Ip desde la que se realiza la ultima accion.';


--
-- TOC entry 9021 (class 0 OID 0)
-- Dependencies: 330
-- Name: COLUMN personajuridicacolectividad.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividad.observacion IS 'Observacion de la persona.';


--
-- TOC entry 331 (class 1259 OID 87125)
-- Dependencies: 7236 7237 7238 7239 7240 7241 7242 7243 11
-- Name: postulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postulado (
    radicado character varying(21) NOT NULL,
    postulado bigint NOT NULL,
    fiscal character varying(10) NOT NULL,
    despacho bigint NOT NULL,
    fechaasignacion date,
    idetapaproceso bigint DEFAULT 0 NOT NULL,
    idsede bigint NOT NULL,
    idgrupoarmado bigint DEFAULT 0 NOT NULL,
    idestructura bigint DEFAULT 0 NOT NULL,
    idbloque bigint DEFAULT 0 NOT NULL,
    idfrente bigint DEFAULT 0 NOT NULL,
    idnivelseguridad bigint DEFAULT 1 NOT NULL,
    usuario character varying(10) NOT NULL,
    esmiembrorepresentante boolean,
    fuecomandante boolean,
    estaprivadolibertad boolean,
    idtipopostulado integer,
    lista integer,
    idversionratifica integer,
    ratificado boolean,
    fecharecepcion date,
    estadopostulado boolean,
    idtipoinactivopostulado integer,
    idtipopreclusionpostulado integer,
    observacion character varying(100),
    reasignacion boolean DEFAULT false NOT NULL,
    numerogrupotrabajo integer,
    adicionaraimputacion boolean DEFAULT false NOT NULL,
    fecharatificacion date
);


ALTER TABLE public.postulado OWNER TO postgres;

--
-- TOC entry 9022 (class 0 OID 0)
-- Dependencies: 331
-- Name: TABLE postulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE postulado IS 'Persona postulada a la ley 975 de Justicia y Paz';


--
-- TOC entry 9023 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.radicado IS 'Numero de radicado en el proceso de justicia y paz';


--
-- TOC entry 9024 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.postulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.postulado IS 'Persona postulada a la ley 975 de justicia y paz';


--
-- TOC entry 9025 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.fiscal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.fiscal IS 'Fiscal dentro de la Unidad nacional de fiscalias para la Justicia y la Paz al cual se encuentra asignado el postulado.';


--
-- TOC entry 9026 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.despacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.despacho IS 'Despacho de la Unidad Nacional de Fiscalias para la Justicia y la Paz a la cual se encuentra asignado el postulado.';


--
-- TOC entry 9027 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.fechaasignacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.fechaasignacion IS 'Fecha en la cual fue asignado el postulado a un fiscal o despacho de la Unidad Nacional de Fiscalias para la Justicia y la Paz.';


--
-- TOC entry 9028 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idetapaproceso IS 'Etapa en la cual se encuentra el proceso de Justicia y Paz.';


--
-- TOC entry 9029 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idsede; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idsede IS 'Sede donde se encuentra el proceso dentro de Justicia y Paz';


--
-- TOC entry 9030 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idgrupoarmado IS 'Grupo armado en el cual se desmovilizo.';


--
-- TOC entry 9031 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idestructura IS 'Estructura en la cual se desmovilizo.';


--
-- TOC entry 9032 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idbloque IS 'Bloque con el cual se desmovilizo.';


--
-- TOC entry 9033 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idfrente IS 'Frente con el cual se desmovilizo.';


--
-- TOC entry 9034 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.idnivelseguridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.idnivelseguridad IS 'Nivel de seguridad que requiere el postulado.';


--
-- TOC entry 9035 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 9036 (class 0 OID 0)
-- Dependencies: 331
-- Name: COLUMN postulado.adicionaraimputacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado.adicionaraimputacion IS 'Determina si el postulado aparece en la lista para hechos a imputar que no lo trato en version libre';


--
-- TOC entry 332 (class 1259 OID 87136)
-- Dependencies: 11
-- Name: relacionpersonajuridicacolectividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonajuridicacolectividad (
    idrelacionpersonajuridicacolectividad integer NOT NULL,
    idpersonajuridicacolectividad integer NOT NULL,
    idpersonanatural integer NOT NULL,
    cargo character varying(50) NOT NULL,
    idtiporelacionpersonajuridicacolectividad integer NOT NULL,
    idtipodocumentopersona integer,
    numerodocumento character varying(20),
    fechaexpedicion date,
    idpaisexpedicion integer,
    iddepartamentoexpedicion integer,
    idmunicipioexpedicion integer,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.relacionpersonajuridicacolectividad OWNER TO postgres;

--
-- TOC entry 9037 (class 0 OID 0)
-- Dependencies: 332
-- Name: TABLE relacionpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionpersonajuridicacolectividad IS 'Relacion de persona juridica o colectividad con persona natural.';


--
-- TOC entry 9038 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idrelacionpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idrelacionpersonajuridicacolectividad IS 'Identificador de la relacion de la persona juridica o colectividad con persona natural.';


--
-- TOC entry 9039 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idpersonajuridicacolectividad IS 'Persona juridica o colectiva.';


--
-- TOC entry 9040 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idpersonanatural; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idpersonanatural IS 'Persona natural.';


--
-- TOC entry 9041 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.cargo IS 'Cargo de la persona relacionada.';


--
-- TOC entry 9042 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idtiporelacionpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idtiporelacionpersonajuridicacolectividad IS 'Tipo de relacion entre las personas.';


--
-- TOC entry 9043 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idtipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idtipodocumentopersona IS 'Tipo de documento soporte de la persona.';


--
-- TOC entry 9044 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.numerodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.numerodocumento IS 'Numero de documento soporte.';


--
-- TOC entry 9045 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.fechaexpedicion IS 'Fecha de expedicion del documento soporte.';


--
-- TOC entry 9046 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idpaisexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idpaisexpedicion IS 'Pais de expedicion del documento soporte.';


--
-- TOC entry 9047 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.iddepartamentoexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.iddepartamentoexpedicion IS 'Departamento de expedicion del documento soporte.';


--
-- TOC entry 9048 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.idmunicipioexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.idmunicipioexpedicion IS 'Municipio de expedicion del documento soporte.';


--
-- TOC entry 9049 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 9050 (class 0 OID 0)
-- Dependencies: 332
-- Name: COLUMN relacionpersonajuridicacolectividad.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonajuridicacolectividad.ip IS 'Ip desde la que se realiza la ultima accion.';


--
-- TOC entry 412 (class 1259 OID 87399)
-- Dependencies: 11
-- Name: departamento_iddepartamento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE departamento_iddepartamento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.departamento_iddepartamento_seq OWNER TO postgres;

--
-- TOC entry 413 (class 1259 OID 87401)
-- Dependencies: 7282 11
-- Name: departamento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE departamento (
    iddepartamento integer DEFAULT nextval('departamento_iddepartamento_seq'::regclass) NOT NULL,
    departamento character varying(80) NOT NULL,
    idpais integer NOT NULL
);


ALTER TABLE public.departamento OWNER TO postgres;

--
-- TOC entry 9051 (class 0 OID 0)
-- Dependencies: 413
-- Name: TABLE departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE departamento IS 'Tabla departamento';


--
-- TOC entry 9052 (class 0 OID 0)
-- Dependencies: 413
-- Name: COLUMN departamento.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN departamento.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9053 (class 0 OID 0)
-- Dependencies: 413
-- Name: COLUMN departamento.departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN departamento.departamento IS 'Nombre del departamento';


--
-- TOC entry 9054 (class 0 OID 0)
-- Dependencies: 413
-- Name: COLUMN departamento.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN departamento.idpais IS 'Identificacion del pais';


--
-- TOC entry 563 (class 1259 OID 87914)
-- Dependencies: 11
-- Name: municipio_idmunicipio_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE municipio_idmunicipio_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.municipio_idmunicipio_seq OWNER TO postgres;

--
-- TOC entry 564 (class 1259 OID 87916)
-- Dependencies: 7348 11
-- Name: municipio; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE municipio (
    idmunicipio integer DEFAULT nextval('municipio_idmunicipio_seq'::regclass) NOT NULL,
    municipio character varying(30) NOT NULL,
    iddepartamento integer NOT NULL,
    idmunicipiodane integer NOT NULL,
    idpais integer NOT NULL
);


ALTER TABLE public.municipio OWNER TO postgres;

--
-- TOC entry 9055 (class 0 OID 0)
-- Dependencies: 564
-- Name: TABLE municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE municipio IS 'Identificador del municipio';


--
-- TOC entry 9056 (class 0 OID 0)
-- Dependencies: 564
-- Name: COLUMN municipio.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN municipio.idmunicipio IS 'Identificador unico del municipio';


--
-- TOC entry 9057 (class 0 OID 0)
-- Dependencies: 564
-- Name: COLUMN municipio.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN municipio.municipio IS 'Nombre del municipio';


--
-- TOC entry 9058 (class 0 OID 0)
-- Dependencies: 564
-- Name: COLUMN municipio.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN municipio.iddepartamento IS 'Identificador unico del departamento';


--
-- TOC entry 9059 (class 0 OID 0)
-- Dependencies: 564
-- Name: COLUMN municipio.idmunicipiodane; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN municipio.idmunicipiodane IS 'Identificador unico del municipio segun dane';


--
-- TOC entry 9060 (class 0 OID 0)
-- Dependencies: 564
-- Name: COLUMN municipio.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN municipio.idpais IS 'Identificador unico del pais';


--
-- TOC entry 587 (class 1259 OID 87983)
-- Dependencies: 11
-- Name: pais_idpais_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pais_idpais_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.pais_idpais_seq OWNER TO postgres;

--
-- TOC entry 588 (class 1259 OID 87985)
-- Dependencies: 7359 11
-- Name: pais; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pais (
    idpais integer DEFAULT nextval('pais_idpais_seq'::regclass) NOT NULL,
    pais character varying(30) NOT NULL
);


ALTER TABLE public.pais OWNER TO postgres;

--
-- TOC entry 9061 (class 0 OID 0)
-- Dependencies: 588
-- Name: TABLE pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE pais IS 'Pais de procedencia';


--
-- TOC entry 9062 (class 0 OID 0)
-- Dependencies: 588
-- Name: COLUMN pais.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN pais.idpais IS 'Identificador unico del pais';


--
-- TOC entry 9063 (class 0 OID 0)
-- Dependencies: 588
-- Name: COLUMN pais.pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN pais.pais IS 'Nombre del pais';


--
-- TOC entry 333 (class 1259 OID 87139)
-- Dependencies: 11
-- Name: accesobloque; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE accesobloque (
    login character varying(10) NOT NULL,
    idbloque integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.accesobloque OWNER TO postgres;

--
-- TOC entry 9064 (class 0 OID 0)
-- Dependencies: 333
-- Name: TABLE accesobloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE accesobloque IS 'Tabla accesso bloque';


--
-- TOC entry 9065 (class 0 OID 0)
-- Dependencies: 333
-- Name: COLUMN accesobloque.login; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque.login IS 'Nombre del usuario';


--
-- TOC entry 9066 (class 0 OID 0)
-- Dependencies: 333
-- Name: COLUMN accesobloque.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque.idbloque IS 'Numero identificacion del bloque';


--
-- TOC entry 9067 (class 0 OID 0)
-- Dependencies: 333
-- Name: COLUMN accesobloque.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 334 (class 1259 OID 87142)
-- Dependencies: 11
-- Name: accesobloque_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE accesobloque_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    login character varying(10) NOT NULL,
    idbloque integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.accesobloque_audit OWNER TO postgres;

--
-- TOC entry 9068 (class 0 OID 0)
-- Dependencies: 334
-- Name: TABLE accesobloque_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE accesobloque_audit IS 'Tabla actualizacion y modificacion acceso bloque';


--
-- TOC entry 9069 (class 0 OID 0)
-- Dependencies: 334
-- Name: COLUMN accesobloque_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9070 (class 0 OID 0)
-- Dependencies: 334
-- Name: COLUMN accesobloque_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque_audit.fechaactualizacion IS 'Fecha en la cual se actualizo la accion';


--
-- TOC entry 9071 (class 0 OID 0)
-- Dependencies: 334
-- Name: COLUMN accesobloque_audit.login; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque_audit.login IS 'Nombre del usuario';


--
-- TOC entry 9072 (class 0 OID 0)
-- Dependencies: 334
-- Name: COLUMN accesobloque_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque_audit.idbloque IS 'Numero identificacion del bloque';


--
-- TOC entry 9073 (class 0 OID 0)
-- Dependencies: 334
-- Name: COLUMN accesobloque_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN accesobloque_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 335 (class 1259 OID 87145)
-- Dependencies: 7246 11
-- Name: acta_asignacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE acta_asignacion (
    idacta integer NOT NULL,
    firma boolean DEFAULT false NOT NULL,
    usuario character varying(10) NOT NULL,
    fiscal character varying(10),
    fecha date,
    jefeunidad character varying(10),
    idtipoactaasignacion integer,
    idtipojefe character varying(1),
    despacho integer
);


ALTER TABLE public.acta_asignacion OWNER TO postgres;

--
-- TOC entry 9074 (class 0 OID 0)
-- Dependencies: 335
-- Name: COLUMN acta_asignacion.idacta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN acta_asignacion.idacta IS 'Identifcador unico para las actas.';


--
-- TOC entry 9075 (class 0 OID 0)
-- Dependencies: 335
-- Name: COLUMN acta_asignacion.firma; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN acta_asignacion.firma IS 'Describe si el acta ya se encuentra firmada.';


--
-- TOC entry 9076 (class 0 OID 0)
-- Dependencies: 335
-- Name: COLUMN acta_asignacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN acta_asignacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 336 (class 1259 OID 87149)
-- Dependencies: 11
-- Name: acta_asignacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE acta_asignacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idacta integer,
    firma boolean,
    usuario character varying(10),
    fiscal character varying(10),
    fecha date,
    jefeunidad character varying(10),
    idtipoactaasignacion integer,
    idtipojefe character varying(1),
    despacho integer
);


ALTER TABLE public.acta_asignacion_audit OWNER TO postgres;

--
-- TOC entry 337 (class 1259 OID 87152)
-- Dependencies: 335 11
-- Name: acta_asignacion_idacta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE acta_asignacion_idacta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.acta_asignacion_idacta_seq OWNER TO postgres;

--
-- TOC entry 9077 (class 0 OID 0)
-- Dependencies: 337
-- Name: acta_asignacion_idacta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE acta_asignacion_idacta_seq OWNED BY acta_asignacion.idacta;


--
-- TOC entry 338 (class 1259 OID 87154)
-- Dependencies: 11
-- Name: actareasignacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actareasignacion (
    idactaasignacion integer NOT NULL,
    idgrupoarmadoanterior integer NOT NULL,
    idestructuraanterior integer NOT NULL,
    idbloqueanterior integer,
    idfrenteanterior integer,
    idgrupoarmadonuevo integer NOT NULL,
    idestructuranueva integer NOT NULL,
    idbloquenuevo integer,
    idfrentenuevo integer,
    soportereasignacion text,
    despachoanterior integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.actareasignacion OWNER TO postgres;

--
-- TOC entry 339 (class 1259 OID 87160)
-- Dependencies: 11
-- Name: actareasignacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actareasignacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idactaasignacion integer,
    idgrupoarmadoanterior integer,
    idestructuraanterior integer,
    idbloqueanterior integer,
    idfrenteanterior integer,
    idgrupoarmadonuevo integer,
    idestructuranueva integer,
    idbloquenuevo integer,
    idfrentenuevo integer,
    soportereasignacion text,
    despachoanterior integer,
    usuario character varying(10)
);


ALTER TABLE public.actareasignacion_audit OWNER TO postgres;

--
-- TOC entry 340 (class 1259 OID 87166)
-- Dependencies: 11
-- Name: actividadfuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actividadfuenteinformacion (
    idactividadfuenteinformacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.actividadfuenteinformacion OWNER TO postgres;

--
-- TOC entry 9078 (class 0 OID 0)
-- Dependencies: 340
-- Name: TABLE actividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE actividadfuenteinformacion IS 'Actividades de la fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 9079 (class 0 OID 0)
-- Dependencies: 340
-- Name: COLUMN actividadfuenteinformacion.idactividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion.idactividadfuenteinformacion IS 'Identifcador unico de actividad de la fuente de informacion';


--
-- TOC entry 9080 (class 0 OID 0)
-- Dependencies: 340
-- Name: COLUMN actividadfuenteinformacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion.descripcion IS 'Descripcion de actividad de la fuente de informacion';


--
-- TOC entry 9081 (class 0 OID 0)
-- Dependencies: 340
-- Name: COLUMN actividadfuenteinformacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 341 (class 1259 OID 87169)
-- Dependencies: 11
-- Name: actividadfuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actividadfuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idactividadfuenteinformacion integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.actividadfuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 9082 (class 0 OID 0)
-- Dependencies: 341
-- Name: COLUMN actividadfuenteinformacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9083 (class 0 OID 0)
-- Dependencies: 341
-- Name: COLUMN actividadfuenteinformacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion_audit.fechaactualizacion IS 'Fecha en la cual se actualizo la accion';


--
-- TOC entry 9084 (class 0 OID 0)
-- Dependencies: 341
-- Name: COLUMN actividadfuenteinformacion_audit.idactividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion_audit.idactividadfuenteinformacion IS 'Identifcador unico de actividad de la fuente de informacion';


--
-- TOC entry 9085 (class 0 OID 0)
-- Dependencies: 341
-- Name: COLUMN actividadfuenteinformacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion_audit.descripcion IS 'Descripcion de actividad de la fuente de informacion';


--
-- TOC entry 9086 (class 0 OID 0)
-- Dependencies: 341
-- Name: COLUMN actividadfuenteinformacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actividadfuenteinformacion_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 342 (class 1259 OID 87172)
-- Dependencies: 340 11
-- Name: actividadfuenteinformacion_idactividadfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE actividadfuenteinformacion_idactividadfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.actividadfuenteinformacion_idactividadfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 9087 (class 0 OID 0)
-- Dependencies: 342
-- Name: actividadfuenteinformacion_idactividadfuenteinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE actividadfuenteinformacion_idactividadfuenteinformacion_seq OWNED BY actividadfuenteinformacion.idactividadfuenteinformacion;


--
-- TOC entry 343 (class 1259 OID 87174)
-- Dependencies: 11
-- Name: actuacionhistoricoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actuacionhistoricoprocesal (
    idhistoricoprocesaldecision integer NOT NULL,
    idhistoricoprocesal integer NOT NULL,
    numerodecision character varying(20) NOT NULL,
    idtipoactuacionhistoricoprocesal integer NOT NULL,
    fechadecision date NOT NULL,
    usuario character varying(10) NOT NULL,
    tiempoduracion integer
);


ALTER TABLE public.actuacionhistoricoprocesal OWNER TO postgres;

--
-- TOC entry 9088 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.idhistoricoprocesaldecision; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.idhistoricoprocesaldecision IS 'Identificador unico de la actuacion historico procesal.';


--
-- TOC entry 9089 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.idhistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.idhistoricoprocesal IS 'Identificador del historico procesal al que esta relacionada la actuacion.';


--
-- TOC entry 9090 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.numerodecision; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.numerodecision IS 'Identificador del numero de decision de la actuacion historico procesal.';


--
-- TOC entry 9091 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.idtipoactuacionhistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.idtipoactuacionhistoricoprocesal IS 'Identificador del tipo de actuacion historico procesal.';


--
-- TOC entry 9092 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.fechadecision; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.fechadecision IS 'Fecha de decision de la actuacion historico procesal.';


--
-- TOC entry 9093 (class 0 OID 0)
-- Dependencies: 343
-- Name: COLUMN actuacionhistoricoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN actuacionhistoricoprocesal.usuario IS 'Usuario que registra la actuacion historico procesal.';


--
-- TOC entry 344 (class 1259 OID 87177)
-- Dependencies: 11
-- Name: actuacionhistoricoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actuacionhistoricoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistoricoprocesaldecision integer,
    idhistoricoprocesal integer,
    numerodecision character varying(20),
    idtipoactuacionhistoricoprocesal integer,
    fechadecision date,
    usuario character varying(10),
    tiempoduracion integer
);


ALTER TABLE public.actuacionhistoricoprocesal_audit OWNER TO postgres;

--
-- TOC entry 345 (class 1259 OID 87180)
-- Dependencies: 343 11
-- Name: actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq OWNER TO postgres;

--
-- TOC entry 9094 (class 0 OID 0)
-- Dependencies: 345
-- Name: actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq OWNED BY actuacionhistoricoprocesal.idhistoricoprocesaldecision;


--
-- TOC entry 346 (class 1259 OID 87182)
-- Dependencies: 11
-- Name: albumfotografico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE albumfotografico (
    idalbumfotografico integer NOT NULL,
    idtipoalbumfotografico integer,
    descripcion character varying(200),
    idgrupoarmado integer,
    idestructura integer,
    idbloque integer,
    idfrente integer,
    estado boolean,
    usuario character varying(10)
);


ALTER TABLE public.albumfotografico OWNER TO postgres;

--
-- TOC entry 9095 (class 0 OID 0)
-- Dependencies: 346
-- Name: TABLE albumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE albumfotografico IS 'Album Fotografico';


--
-- TOC entry 9096 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idalbumfotografico IS 'Identificador unico del album fotografico.';


--
-- TOC entry 9097 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idtipoalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idtipoalbumfotografico IS 'Tipo del album fotografico.';


--
-- TOC entry 9098 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.descripcion IS 'Descripcion del album fotografico.';


--
-- TOC entry 9099 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idgrupoarmado IS 'Grupo armado referente del album fotografico.';


--
-- TOC entry 9100 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idestructura IS 'Estructura referente del album fotografico.';


--
-- TOC entry 9101 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idbloque IS 'Bloque referente del album fotografico.';


--
-- TOC entry 9102 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.idfrente IS 'Frente referente al album fotografico.';


--
-- TOC entry 9103 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN albumfotografico.estado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotografico.estado IS 'Estado del album fotografico.';


--
-- TOC entry 347 (class 1259 OID 87185)
-- Dependencies: 11
-- Name: albumfotografico_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE albumfotografico_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idalbumfotografico integer,
    idtipoalbumfotografico integer,
    descripcion character varying(200),
    idgrupoarmado integer,
    idestructura integer,
    idbloque integer,
    idfrente integer,
    estado boolean,
    usuario character varying(10)
);


ALTER TABLE public.albumfotografico_audit OWNER TO postgres;

--
-- TOC entry 348 (class 1259 OID 87188)
-- Dependencies: 346 11
-- Name: albumfotografico_idalbumfotografico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE albumfotografico_idalbumfotografico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.albumfotografico_idalbumfotografico_seq OWNER TO postgres;

--
-- TOC entry 9104 (class 0 OID 0)
-- Dependencies: 348
-- Name: albumfotografico_idalbumfotografico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE albumfotografico_idalbumfotografico_seq OWNED BY albumfotografico.idalbumfotografico;


--
-- TOC entry 349 (class 1259 OID 87190)
-- Dependencies: 11
-- Name: albumfotograficodownload; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE albumfotograficodownload (
    idalbumfotograficodownload integer NOT NULL,
    idalbumfotografico integer,
    fechadescarga time without time zone,
    clavealbumfotografico character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.albumfotograficodownload OWNER TO postgres;

--
-- TOC entry 9105 (class 0 OID 0)
-- Dependencies: 349
-- Name: TABLE albumfotograficodownload; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE albumfotograficodownload IS 'Registros de descargas de albumes fotograficos.';


--
-- TOC entry 9106 (class 0 OID 0)
-- Dependencies: 349
-- Name: COLUMN albumfotograficodownload.idalbumfotograficodownload; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotograficodownload.idalbumfotograficodownload IS 'Identificador unico de la descarga del album fotografico.';


--
-- TOC entry 9107 (class 0 OID 0)
-- Dependencies: 349
-- Name: COLUMN albumfotograficodownload.idalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotograficodownload.idalbumfotografico IS 'Identificador del album fotografico.';


--
-- TOC entry 9108 (class 0 OID 0)
-- Dependencies: 349
-- Name: COLUMN albumfotograficodownload.fechadescarga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotograficodownload.fechadescarga IS 'Fecha de descarga del album fotografico.';


--
-- TOC entry 9109 (class 0 OID 0)
-- Dependencies: 349
-- Name: COLUMN albumfotograficodownload.clavealbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotograficodownload.clavealbumfotografico IS 'Clave del album fotografico descargado.';


--
-- TOC entry 9110 (class 0 OID 0)
-- Dependencies: 349
-- Name: COLUMN albumfotograficodownload.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN albumfotograficodownload.usuario IS 'Usuario que realiza la descarga del album fotografico.';


--
-- TOC entry 350 (class 1259 OID 87193)
-- Dependencies: 11
-- Name: albumfotograficodownload_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE albumfotograficodownload_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idalbumfotograficodownload integer NOT NULL,
    idalbumfotografico integer,
    fechadescarga time without time zone,
    clavealbumfotografico character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.albumfotograficodownload_audit OWNER TO postgres;

--
-- TOC entry 351 (class 1259 OID 87196)
-- Dependencies: 350 11
-- Name: albumfotograficodownload_audit_idalbumfotograficodownload_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE albumfotograficodownload_audit_idalbumfotograficodownload_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.albumfotograficodownload_audit_idalbumfotograficodownload_seq OWNER TO postgres;

--
-- TOC entry 9111 (class 0 OID 0)
-- Dependencies: 351
-- Name: albumfotograficodownload_audit_idalbumfotograficodownload_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE albumfotograficodownload_audit_idalbumfotograficodownload_seq OWNED BY albumfotograficodownload_audit.idalbumfotograficodownload;


--
-- TOC entry 352 (class 1259 OID 87198)
-- Dependencies: 349 11
-- Name: albumfotograficodownload_idalbumfotograficodownload_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE albumfotograficodownload_idalbumfotograficodownload_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.albumfotograficodownload_idalbumfotograficodownload_seq OWNER TO postgres;

--
-- TOC entry 9112 (class 0 OID 0)
-- Dependencies: 352
-- Name: albumfotograficodownload_idalbumfotograficodownload_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE albumfotograficodownload_idalbumfotograficodownload_seq OWNED BY albumfotograficodownload.idalbumfotograficodownload;


--
-- TOC entry 353 (class 1259 OID 87200)
-- Dependencies: 11
-- Name: apelacionterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE apelacionterminacionprocesopostulado (
    iddecisionterminacion integer NOT NULL,
    idtipoparticipanteaudiencia integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.apelacionterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 354 (class 1259 OID 87203)
-- Dependencies: 11
-- Name: apelacionterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE apelacionterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddecisionterminacion integer,
    idtipoparticipanteaudiencia integer,
    usuario character varying(10)
);


ALTER TABLE public.apelacionterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 355 (class 1259 OID 87206)
-- Dependencies: 7252 11
-- Name: apoderado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE apoderado (
    idpersonaapoderado integer NOT NULL,
    idpersonarepresentado integer NOT NULL,
    activo smallint DEFAULT 0 NOT NULL,
    usuario character varying(10) NOT NULL,
    idtipoapoderado bigint,
    ip character varying(15)
);


ALTER TABLE public.apoderado OWNER TO postgres;

--
-- TOC entry 9113 (class 0 OID 0)
-- Dependencies: 355
-- Name: TABLE apoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE apoderado IS 'Registro de apoderados.';


--
-- TOC entry 9114 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.idpersonaapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.idpersonaapoderado IS 'Identificador de la persona apoderado.';


--
-- TOC entry 9115 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.idpersonarepresentado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.idpersonarepresentado IS 'Identificador de la persona representada.';


--
-- TOC entry 9116 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.activo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.activo IS '(0: SI la relacion se encuentra activa, 1: Si la relacion no se encuentra activa)';


--
-- TOC entry 9117 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.usuario IS 'Ultimo usuario que realiza la actualizacion.';


--
-- TOC entry 9118 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.idtipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.idtipoapoderado IS 'Identificador del tipo de apoderado.';


--
-- TOC entry 9119 (class 0 OID 0)
-- Dependencies: 355
-- Name: COLUMN apoderado.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado.ip IS 'Ip de ultima accion.';


--
-- TOC entry 356 (class 1259 OID 87210)
-- Dependencies: 11
-- Name: apoderado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE apoderado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonaapoderado bigint,
    idpersonarepresentado bigint,
    activo smallint,
    usuario character varying(10),
    idtipoapoderado bigint,
    ip character varying(15)
);


ALTER TABLE public.apoderado_audit OWNER TO postgres;

--
-- TOC entry 9120 (class 0 OID 0)
-- Dependencies: 356
-- Name: TABLE apoderado_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE apoderado_audit IS 'Actualizacion  apoderado_audit';


--
-- TOC entry 9121 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9122 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.fechaactualizacion IS 'fecha de actualizacion';


--
-- TOC entry 9123 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.idpersonaapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.idpersonaapoderado IS 'Identificador de la persona apoderado.';


--
-- TOC entry 9124 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.idpersonarepresentado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.idpersonarepresentado IS 'Identificador de la persona representada.';


--
-- TOC entry 9125 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.activo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.activo IS '(0: SI la relacion se encuentra activa, 1: Si la relacion no se encuentra activa)';


--
-- TOC entry 9126 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.usuario IS 'Ultimo usuario que realiza la actualizacion.';


--
-- TOC entry 9127 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.idtipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.idtipoapoderado IS 'Identificador del tipo de apoderado.';


--
-- TOC entry 9128 (class 0 OID 0)
-- Dependencies: 356
-- Name: COLUMN apoderado_audit.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN apoderado_audit.ip IS 'Ip de ultima accion.';


--
-- TOC entry 357 (class 1259 OID 87213)
-- Dependencies: 7254 11
-- Name: asignaciongrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE asignaciongrupoarmado (
    idasignaciongrupoarmado integer NOT NULL,
    numerogrupoarmado character varying(10) NOT NULL,
    despacho integer NOT NULL,
    fiscal character varying(10) NOT NULL,
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    idresolucionasignacion integer NOT NULL,
    estado boolean DEFAULT false NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.asignaciongrupoarmado OWNER TO postgres;

--
-- TOC entry 358 (class 1259 OID 87217)
-- Dependencies: 11
-- Name: asignaciongrupoarmado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE asignaciongrupoarmado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idasignaciongrupoarmado integer NOT NULL,
    numerogrupoarmado character varying(10) NOT NULL,
    despacho integer NOT NULL,
    fiscal character varying(10) NOT NULL,
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    idresolucionasignacion integer NOT NULL,
    estado boolean NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.asignaciongrupoarmado_audit OWNER TO postgres;

--
-- TOC entry 359 (class 1259 OID 87220)
-- Dependencies: 358 11
-- Name: asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9129 (class 0 OID 0)
-- Dependencies: 359
-- Name: asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq OWNED BY asignaciongrupoarmado_audit.idasignaciongrupoarmado;


--
-- TOC entry 360 (class 1259 OID 87222)
-- Dependencies: 357 11
-- Name: asignaciongrupoarmado_idasignaciongrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE asignaciongrupoarmado_idasignaciongrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.asignaciongrupoarmado_idasignaciongrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9130 (class 0 OID 0)
-- Dependencies: 360
-- Name: asignaciongrupoarmado_idasignaciongrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE asignaciongrupoarmado_idasignaciongrupoarmado_seq OWNED BY asignaciongrupoarmado.idasignaciongrupoarmado;


--
-- TOC entry 361 (class 1259 OID 87224)
-- Dependencies: 11
-- Name: asignaciongrupoarmadohistorico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE asignaciongrupoarmadohistorico (
    idasignaciongrupoarmado integer NOT NULL,
    idresolucionasignacion integer NOT NULL,
    fechaactualizacion date NOT NULL,
    numerogrupoarmado character varying(10) NOT NULL,
    fiscal character varying(10) NOT NULL,
    despacho integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.asignaciongrupoarmadohistorico OWNER TO postgres;

--
-- TOC entry 362 (class 1259 OID 87227)
-- Dependencies: 361 11
-- Name: asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9131 (class 0 OID 0)
-- Dependencies: 362
-- Name: asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq OWNED BY asignaciongrupoarmadohistorico.idasignaciongrupoarmado;


--
-- TOC entry 363 (class 1259 OID 87229)
-- Dependencies: 7257 7258 7259 7260 7261 11
-- Name: asignacionpostulados; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE asignacionpostulados (
    fechaactualizacion timestamp without time zone,
    radicado character varying(21) NOT NULL,
    fiscal character varying(10),
    despacho integer NOT NULL,
    fechaasignacion date,
    idetapaproceso integer DEFAULT 0 NOT NULL,
    idsede integer NOT NULL,
    idgrupoarmado integer DEFAULT 0 NOT NULL,
    idestructura integer DEFAULT 0 NOT NULL,
    idbloque integer DEFAULT 0 NOT NULL,
    idfrente integer DEFAULT 0 NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.asignacionpostulados OWNER TO postgres;

--
-- TOC entry 364 (class 1259 OID 87237)
-- Dependencies: 11
-- Name: audiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE audiencia (
    idaudiencia integer NOT NULL,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    idtipoaudiencia integer NOT NULL,
    fecharadicacion date,
    fechaarealizar date,
    idmagistradoponente integer,
    esparcial boolean,
    usuario character varying(10)
);


ALTER TABLE public.audiencia OWNER TO postgres;

--
-- TOC entry 365 (class 1259 OID 87240)
-- Dependencies: 11
-- Name: audiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE audiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idaudiencia integer,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    idtipoaudiencia integer NOT NULL,
    fecharadicacion date,
    fechaarealizar date,
    idmagistradoponente integer,
    esparcial boolean,
    usuario character varying(10)
);


ALTER TABLE public.audiencia_audit OWNER TO postgres;

--
-- TOC entry 366 (class 1259 OID 87243)
-- Dependencies: 364 11
-- Name: audiencia_idaudiencia_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE audiencia_idaudiencia_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.audiencia_idaudiencia_seq OWNER TO postgres;

--
-- TOC entry 9132 (class 0 OID 0)
-- Dependencies: 366
-- Name: audiencia_idaudiencia_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE audiencia_idaudiencia_seq OWNED BY audiencia.idaudiencia;


--
-- TOC entry 367 (class 1259 OID 87245)
-- Dependencies: 11
-- Name: autoridad_idautoridad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE autoridad_idautoridad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.autoridad_idautoridad_seq OWNER TO postgres;

--
-- TOC entry 368 (class 1259 OID 87247)
-- Dependencies: 7263 11
-- Name: autoridad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE autoridad (
    idautoridad integer DEFAULT nextval('autoridad_idautoridad_seq'::regclass) NOT NULL,
    nombreautoridad character varying(60) NOT NULL,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    direccion character varying(200)
);


ALTER TABLE public.autoridad OWNER TO postgres;

--
-- TOC entry 9133 (class 0 OID 0)
-- Dependencies: 368
-- Name: TABLE autoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE autoridad IS 'Ubicacion y nombre de la autoridad';


--
-- TOC entry 9134 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.idautoridad IS 'Numero unico de identificacion de la autoridad.';


--
-- TOC entry 9135 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.nombreautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.nombreautoridad IS 'Nombre de la autoridad o entidad relacionadas';


--
-- TOC entry 9136 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.idpais IS 'Numero de identificacion del pais';


--
-- TOC entry 9137 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.iddepartamento IS 'Numero de identificacion por departamento.';


--
-- TOC entry 9138 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.idmunicipio IS 'Identificaion del municipio';


--
-- TOC entry 9139 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN autoridad.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN autoridad.direccion IS 'Direccion de la autoridad o entidad relacionada en la tabla.';


--
-- TOC entry 369 (class 1259 OID 87251)
-- Dependencies: 11
-- Name: bien_idbien_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE bien_idbien_seq
    START WITH 0
    INCREMENT BY 1
    MINVALUE 0
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.bien_idbien_seq OWNER TO postgres;

--
-- TOC entry 370 (class 1259 OID 87253)
-- Dependencies: 7264 11
-- Name: bien; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bien (
    idbien bigint DEFAULT nextval('bien_idbien_seq'::regclass) NOT NULL,
    idelemento integer,
    idorigen integer,
    idtipoadquisicion integer,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimiento character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    direccion character varying(200),
    finca character varying(100),
    sitio character varying(200),
    barrio character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.bien OWNER TO postgres;

--
-- TOC entry 9140 (class 0 OID 0)
-- Dependencies: 370
-- Name: TABLE bien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE bien IS 'Tabla que relaciona las caracteristicas y ubicacion del bien';


--
-- TOC entry 9141 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idbien IS 'Numero de identificacion del bien';


--
-- TOC entry 9142 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idelemento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idelemento IS 'Numero de identificacion del elemento';


--
-- TOC entry 9143 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idorigen; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idorigen IS 'Numero de identificacion unico sobre el origen del bien';


--
-- TOC entry 9144 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idtipoadquisicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idtipoadquisicion IS 'Identificacion de la forma como se adquirio el bien';


--
-- TOC entry 9145 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idpais IS 'Identificacion del pais';


--
-- TOC entry 9146 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9147 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9148 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.corregimiento IS 'Nombre del corregimiento donde esta ubicado el bien';


--
-- TOC entry 9149 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.vereda IS 'Nombre de la vereda';


--
-- TOC entry 9150 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.inspeccion IS 'Nombre de la inspeccion';


--
-- TOC entry 9151 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.direccion IS 'Direccion de la ubicacion del bien';


--
-- TOC entry 9152 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.finca IS 'Nombre de la finca';


--
-- TOC entry 9153 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.sitio IS 'Especificacion del sitio o lugar de ubicacion del bien';


--
-- TOC entry 9154 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.barrio IS 'Nombre del barrio';


--
-- TOC entry 9155 (class 0 OID 0)
-- Dependencies: 370
-- Name: COLUMN bien.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 371 (class 1259 OID 87257)
-- Dependencies: 11
-- Name: bien_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bien_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idbien integer NOT NULL,
    idelemento integer,
    idorigen integer,
    idtipoadquisicion integer,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimiento character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    direccion character varying(200),
    finca character varying(100),
    sitio character varying(200),
    barrio character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.bien_audit OWNER TO postgres;

--
-- TOC entry 9156 (class 0 OID 0)
-- Dependencies: 371
-- Name: TABLE bien_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE bien_audit IS 'Actualizacion o modificacion de la tabla ';


--
-- TOC entry 9157 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9158 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.fechaactualizacion IS 'Fecha en la cual realizo la accion';


--
-- TOC entry 9159 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idbien IS 'Numero identificacion del bien';


--
-- TOC entry 9160 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idelemento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idelemento IS 'Numero de identificacion del elemento';


--
-- TOC entry 9161 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idorigen; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idorigen IS 'Numero de identificacion unico sobre el origen del bien';


--
-- TOC entry 9162 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idtipoadquisicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idtipoadquisicion IS 'Identificacion de la forma como se adquirio el bien';


--
-- TOC entry 9163 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idpais IS 'Identificacion del pais';


--
-- TOC entry 9164 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9165 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9166 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.corregimiento IS 'Nombre del corregimiento donde esta ubicado el bien';


--
-- TOC entry 9167 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.vereda IS 'Nombre de la vereda';


--
-- TOC entry 9168 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.inspeccion IS 'No0mbre de la inspeccion';


--
-- TOC entry 9169 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.direccion IS 'Direccion de la ubicacion del bien';


--
-- TOC entry 9170 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.finca IS 'Nombre de la finca';


--
-- TOC entry 9171 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.sitio IS 'Especificacion del sitio o lugar de ubicacion del bien';


--
-- TOC entry 9172 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.barrio IS 'Nombre del barrio';


--
-- TOC entry 9173 (class 0 OID 0)
-- Dependencies: 371
-- Name: COLUMN bien_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bien_audit.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 372 (class 1259 OID 87260)
-- Dependencies: 11
-- Name: bienesentregadosdesmovilizacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bienesentregadosdesmovilizacion (
    idbien integer NOT NULL,
    iddesmovilizacion integer NOT NULL,
    fechaentrega date,
    usuario character varying(10)
);


ALTER TABLE public.bienesentregadosdesmovilizacion OWNER TO postgres;

--
-- TOC entry 9174 (class 0 OID 0)
-- Dependencies: 372
-- Name: TABLE bienesentregadosdesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE bienesentregadosdesmovilizacion IS 'Bienes entregados en el proceso de desmovilizacion';


--
-- TOC entry 9175 (class 0 OID 0)
-- Dependencies: 372
-- Name: COLUMN bienesentregadosdesmovilizacion.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion.idbien IS 'Numero identificacion del bien';


--
-- TOC entry 9176 (class 0 OID 0)
-- Dependencies: 372
-- Name: COLUMN bienesentregadosdesmovilizacion.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion.iddesmovilizacion IS 'Identificacion desmovilizacion';


--
-- TOC entry 9177 (class 0 OID 0)
-- Dependencies: 372
-- Name: COLUMN bienesentregadosdesmovilizacion.fechaentrega; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion.fechaentrega IS 'Fecha de entrega';


--
-- TOC entry 9178 (class 0 OID 0)
-- Dependencies: 372
-- Name: COLUMN bienesentregadosdesmovilizacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 373 (class 1259 OID 87263)
-- Dependencies: 11
-- Name: bienesentregadosdesmovilizacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bienesentregadosdesmovilizacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idbien integer NOT NULL,
    iddesmovilizacion integer NOT NULL,
    fechaentrega date,
    usuario character varying(10)
);


ALTER TABLE public.bienesentregadosdesmovilizacion_audit OWNER TO postgres;

--
-- TOC entry 9179 (class 0 OID 0)
-- Dependencies: 373
-- Name: TABLE bienesentregadosdesmovilizacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE bienesentregadosdesmovilizacion_audit IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9180 (class 0 OID 0)
-- Dependencies: 373
-- Name: COLUMN bienesentregadosdesmovilizacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion_audit.fechaactualizacion IS 'Fecha en la cual realizo la accion';


--
-- TOC entry 9181 (class 0 OID 0)
-- Dependencies: 373
-- Name: COLUMN bienesentregadosdesmovilizacion_audit.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion_audit.idbien IS 'Numero identificacion del bien';


--
-- TOC entry 9182 (class 0 OID 0)
-- Dependencies: 373
-- Name: COLUMN bienesentregadosdesmovilizacion_audit.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion_audit.iddesmovilizacion IS 'Identificacion desmovilizacion';


--
-- TOC entry 9183 (class 0 OID 0)
-- Dependencies: 373
-- Name: COLUMN bienesentregadosdesmovilizacion_audit.fechaentrega; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion_audit.fechaentrega IS 'Fecha de entrega';


--
-- TOC entry 9184 (class 0 OID 0)
-- Dependencies: 373
-- Name: COLUMN bienesentregadosdesmovilizacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bienesentregadosdesmovilizacion_audit.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 374 (class 1259 OID 87266)
-- Dependencies: 11
-- Name: bloque_idbloque_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE bloque_idbloque_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.bloque_idbloque_seq OWNER TO postgres;

--
-- TOC entry 375 (class 1259 OID 87268)
-- Dependencies: 7265 7266 11
-- Name: bloque; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bloque (
    idbloque integer DEFAULT nextval('bloque_idbloque_seq'::regclass) NOT NULL,
    idestructura integer NOT NULL,
    bloque character varying(100) NOT NULL,
    idpersona integer DEFAULT 0
);


ALTER TABLE public.bloque OWNER TO postgres;

--
-- TOC entry 9185 (class 0 OID 0)
-- Dependencies: 375
-- Name: COLUMN bloque.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bloque.idbloque IS 'Numero de identificacion del bloque';


--
-- TOC entry 9186 (class 0 OID 0)
-- Dependencies: 375
-- Name: COLUMN bloque.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bloque.idestructura IS 'Numero de identificacion de la estructura';


--
-- TOC entry 9187 (class 0 OID 0)
-- Dependencies: 375
-- Name: COLUMN bloque.bloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bloque.bloque IS 'Nombre del bloque';


--
-- TOC entry 9188 (class 0 OID 0)
-- Dependencies: 375
-- Name: COLUMN bloque.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN bloque.idpersona IS 'Numero identificacion de la persona';


--
-- TOC entry 376 (class 1259 OID 87273)
-- Dependencies: 11
-- Name: calidadvictima_idcalidadvictima_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE calidadvictima_idcalidadvictima_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.calidadvictima_idcalidadvictima_seq OWNER TO postgres;

--
-- TOC entry 377 (class 1259 OID 87275)
-- Dependencies: 7267 11
-- Name: calidadvictima; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE calidadvictima (
    idcalidadvictima integer DEFAULT nextval('calidadvictima_idcalidadvictima_seq'::regclass) NOT NULL,
    nombrecalidadvictima character varying(100) NOT NULL
);


ALTER TABLE public.calidadvictima OWNER TO postgres;

--
-- TOC entry 9189 (class 0 OID 0)
-- Dependencies: 377
-- Name: TABLE calidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE calidadvictima IS 'Calidad de la victima en el momento de los hechos';


--
-- TOC entry 9190 (class 0 OID 0)
-- Dependencies: 377
-- Name: COLUMN calidadvictima.idcalidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN calidadvictima.idcalidadvictima IS 'Numero identificacion calidad de la victima';


--
-- TOC entry 9191 (class 0 OID 0)
-- Dependencies: 377
-- Name: COLUMN calidadvictima.nombrecalidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN calidadvictima.nombrecalidadvictima IS 'Nombre calidada de la victima';


--
-- TOC entry 952 (class 1259 OID 125836)
-- Dependencies: 11
-- Name: campo_idequipodiligenciaexhumacion_seq; Type: SEQUENCE; Schema: public; Owner: sijyp
--

CREATE SEQUENCE campo_idequipodiligenciaexhumacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483648
    CACHE 1;


ALTER TABLE public.campo_idequipodiligenciaexhumacion_seq OWNER TO sijyp;

--
-- TOC entry 378 (class 1259 OID 87279)
-- Dependencies: 11
-- Name: caracteristica; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE caracteristica (
    idbien integer NOT NULL,
    valor character varying(100),
    idcaracteristica integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.caracteristica OWNER TO postgres;

--
-- TOC entry 9192 (class 0 OID 0)
-- Dependencies: 378
-- Name: COLUMN caracteristica.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica.idbien IS 'Identificacion unica del bien';


--
-- TOC entry 9193 (class 0 OID 0)
-- Dependencies: 378
-- Name: COLUMN caracteristica.valor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica.valor IS 'Valor cuantificable del bien';


--
-- TOC entry 9194 (class 0 OID 0)
-- Dependencies: 378
-- Name: COLUMN caracteristica.idcaracteristica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica.idcaracteristica IS 'Identificacion de la caracteristica';


--
-- TOC entry 9195 (class 0 OID 0)
-- Dependencies: 378
-- Name: COLUMN caracteristica.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 379 (class 1259 OID 87282)
-- Dependencies: 11
-- Name: caracteristica_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE caracteristica_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idbien integer NOT NULL,
    valor character varying(100),
    idcaracteristica integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.caracteristica_audit OWNER TO postgres;

--
-- TOC entry 9196 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9197 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9198 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.idbien IS 'Identificacion unica del bien';


--
-- TOC entry 9199 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.valor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.valor IS 'Valor cuantificable del bien';


--
-- TOC entry 9200 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.idcaracteristica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.idcaracteristica IS 'Identificacion de la caracteristica';


--
-- TOC entry 9201 (class 0 OID 0)
-- Dependencies: 379
-- Name: COLUMN caracteristica_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN caracteristica_audit.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 380 (class 1259 OID 87285)
-- Dependencies: 11
-- Name: cargo_idcargo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE cargo_idcargo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.cargo_idcargo_seq OWNER TO postgres;

--
-- TOC entry 381 (class 1259 OID 87287)
-- Dependencies: 7268 11
-- Name: cargo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cargo (
    idcargo integer DEFAULT nextval('cargo_idcargo_seq'::regclass) NOT NULL,
    cargo character varying(100) NOT NULL
);


ALTER TABLE public.cargo OWNER TO postgres;

--
-- TOC entry 9202 (class 0 OID 0)
-- Dependencies: 381
-- Name: COLUMN cargo.idcargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN cargo.idcargo IS 'Identificacion del cargo';


--
-- TOC entry 9203 (class 0 OID 0)
-- Dependencies: 381
-- Name: COLUMN cargo.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN cargo.cargo IS 'NOMBRE DEL CARGO';


--
-- TOC entry 382 (class 1259 OID 87291)
-- Dependencies: 7270 7271 11
-- Name: carpetahecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE carpetahecho (
    idcarpetahecho integer NOT NULL,
    titulo text NOT NULL,
    idautoridad integer NOT NULL,
    fiscal character varying(10),
    iddepartamento integer NOT NULL,
    idmunicipio integer NOT NULL,
    lugar character varying(100) NOT NULL,
    fechacreacion date NOT NULL,
    idorigencarpeta integer NOT NULL,
    fechaorigencarpeta date NOT NULL,
    observacion text NOT NULL,
    estado smallint NOT NULL,
    usuario character varying(10) NOT NULL,
    seconfeso boolean DEFAULT false NOT NULL,
    seimputo boolean DEFAULT false NOT NULL
);


ALTER TABLE public.carpetahecho OWNER TO postgres;

--
-- TOC entry 9204 (class 0 OID 0)
-- Dependencies: 382
-- Name: TABLE carpetahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE carpetahecho IS 'Carpeta de hechos, relaciona hechos dentro de una sola carpeta.';


--
-- TOC entry 9205 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.idcarpetahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.idcarpetahecho IS 'Identificador unico de la carpeta de hecho.';


--
-- TOC entry 9206 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.titulo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.titulo IS 'Titulo de la carpeta.';


--
-- TOC entry 9207 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.idautoridad IS 'Despacho que lleva el proceso dentro de Justicia y Paz.';


--
-- TOC entry 9208 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.fiscal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.fiscal IS 'Fiscal que lleva el proceso dentro de Justicia y Paz.';


--
-- TOC entry 9209 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.iddepartamento IS 'Departamento donde se encuentra ubicado el archivo fisico original que contiene los datos que se ingresaron al sistema.';


--
-- TOC entry 9210 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.idmunicipio IS 'Municipio donde se encuentra el archivo fisico original que contiene los datos que se ingresaron al sistema.';


--
-- TOC entry 9211 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.lugar; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.lugar IS 'Observaciion respecto a la ubicacion especifica del archivo fisico.';


--
-- TOC entry 9212 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.fechacreacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.fechacreacion IS 'Fecha de la creacion de la carpeta.';


--
-- TOC entry 9213 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.idorigencarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.idorigencarpeta IS 'Describe el origen de la carpeta, tomado del  hecho que tiene la fecha de conocimiento mas antigua de los que se encuentran en la carpeta.';


--
-- TOC entry 9214 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.fechaorigencarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.fechaorigencarpeta IS 'Fecha de conocimiento mas antigua de los hechos que se encuentran en la carpeta.';


--
-- TOC entry 9215 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.observacion IS 'Comentarios del despacho acerca de la carpeta.';


--
-- TOC entry 9216 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.estado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.estado IS 'Control de la carpeta para identificar si la carpeta esta activa o no (0=Activo,1=Inactivo).';


--
-- TOC entry 9217 (class 0 OID 0)
-- Dependencies: 382
-- Name: COLUMN carpetahecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN carpetahecho.usuario IS 'Usuarion que realiza la ultima actualizacion sobre la carpeta.';


--
-- TOC entry 383 (class 1259 OID 87299)
-- Dependencies: 11
-- Name: carpetahecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE carpetahecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcarpetahecho integer NOT NULL,
    titulo text,
    idautoridad integer,
    fiscal character varying(10),
    iddepartamento integer,
    idmunicipio integer,
    lugar character varying(100),
    fechacreacion date,
    idorigencarpeta integer,
    fechaorigencarpeta date,
    observacion text,
    estado smallint,
    usuario character varying(10),
    seconfeso boolean,
    seimputo boolean
);


ALTER TABLE public.carpetahecho_audit OWNER TO postgres;

--
-- TOC entry 384 (class 1259 OID 87305)
-- Dependencies: 382 11
-- Name: carpetahecho_idcarpetahecho_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE carpetahecho_idcarpetahecho_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.carpetahecho_idcarpetahecho_seq OWNER TO postgres;

--
-- TOC entry 9218 (class 0 OID 0)
-- Dependencies: 384
-- Name: carpetahecho_idcarpetahecho_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE carpetahecho_idcarpetahecho_seq OWNED BY carpetahecho.idcarpetahecho;


--
-- TOC entry 385 (class 1259 OID 87307)
-- Dependencies: 11
-- Name: causaterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE causaterminacionprocesopostulado (
    idcausaterminacion integer NOT NULL,
    causaterminacion character varying(200) NOT NULL,
    idtipoterminacion integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.causaterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 386 (class 1259 OID 87310)
-- Dependencies: 11
-- Name: causaterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE causaterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcausaterminacion integer,
    causaterminacion character varying(200) NOT NULL,
    idtipoterminacion integer,
    usuario character varying(10)
);


ALTER TABLE public.causaterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 387 (class 1259 OID 87313)
-- Dependencies: 385 11
-- Name: causaterminacionprocesopostulado_idcausaterminacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE causaterminacionprocesopostulado_idcausaterminacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.causaterminacionprocesopostulado_idcausaterminacion_seq OWNER TO postgres;

--
-- TOC entry 9219 (class 0 OID 0)
-- Dependencies: 387
-- Name: causaterminacionprocesopostulado_idcausaterminacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE causaterminacionprocesopostulado_idcausaterminacion_seq OWNED BY causaterminacionprocesopostulado.idcausaterminacion;


--
-- TOC entry 388 (class 1259 OID 87315)
-- Dependencies: 11
-- Name: clasedesmovilizacion_idclasedesmovilizacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE clasedesmovilizacion_idclasedesmovilizacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.clasedesmovilizacion_idclasedesmovilizacion_seq OWNER TO postgres;

--
-- TOC entry 389 (class 1259 OID 87317)
-- Dependencies: 7273 11
-- Name: clasedesmovilizacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE clasedesmovilizacion (
    idclasedesmovilizacion integer DEFAULT nextval('clasedesmovilizacion_idclasedesmovilizacion_seq'::regclass) NOT NULL,
    clasedesmovilizacion character varying(22),
    usuario character varying(10)
);


ALTER TABLE public.clasedesmovilizacion OWNER TO postgres;

--
-- TOC entry 9220 (class 0 OID 0)
-- Dependencies: 389
-- Name: TABLE clasedesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE clasedesmovilizacion IS 'clase de desmovilizacion';


--
-- TOC entry 9221 (class 0 OID 0)
-- Dependencies: 389
-- Name: COLUMN clasedesmovilizacion.idclasedesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN clasedesmovilizacion.idclasedesmovilizacion IS 'Identificacion clase desmovilizacion';


--
-- TOC entry 9222 (class 0 OID 0)
-- Dependencies: 389
-- Name: COLUMN clasedesmovilizacion.clasedesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN clasedesmovilizacion.clasedesmovilizacion IS 'Clase de desmoviilizacion';


--
-- TOC entry 390 (class 1259 OID 87321)
-- Dependencies: 11
-- Name: clasedesmovilizacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE clasedesmovilizacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idclasedesmovilizacion integer,
    clasedesmovilizacion character varying(22),
    usuario character varying(10)
);


ALTER TABLE public.clasedesmovilizacion_audit OWNER TO postgres;

--
-- TOC entry 391 (class 1259 OID 87324)
-- Dependencies: 11
-- Name: compulsacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE compulsacion (
    idcompulsacion integer NOT NULL,
    idtipocompulsacion integer NOT NULL,
    idevento integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.compulsacion OWNER TO postgres;

--
-- TOC entry 9223 (class 0 OID 0)
-- Dependencies: 391
-- Name: COLUMN compulsacion.idcompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN compulsacion.idcompulsacion IS 'Identifcador unico de la compulsacion.';


--
-- TOC entry 9224 (class 0 OID 0)
-- Dependencies: 391
-- Name: COLUMN compulsacion.idtipocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN compulsacion.idtipocompulsacion IS 'identificador del tipo de compulsacion.';


--
-- TOC entry 9225 (class 0 OID 0)
-- Dependencies: 391
-- Name: COLUMN compulsacion.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN compulsacion.idevento IS 'Identificador del evento al que se asocia la compulsacion.';


--
-- TOC entry 9226 (class 0 OID 0)
-- Dependencies: 391
-- Name: COLUMN compulsacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN compulsacion.usuario IS 'Usuario que realiza la compulsacion.';


--
-- TOC entry 392 (class 1259 OID 87327)
-- Dependencies: 11
-- Name: compulsacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE compulsacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcompulsacion integer,
    idtipocompulsacion integer,
    idevento integer,
    usuario character varying(10)
);


ALTER TABLE public.compulsacion_audit OWNER TO postgres;

--
-- TOC entry 393 (class 1259 OID 87330)
-- Dependencies: 391 11
-- Name: compulsacion_idcompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE compulsacion_idcompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.compulsacion_idcompulsacion_seq OWNER TO postgres;

--
-- TOC entry 9227 (class 0 OID 0)
-- Dependencies: 393
-- Name: compulsacion_idcompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE compulsacion_idcompulsacion_seq OWNED BY compulsacion.idcompulsacion;


--
-- TOC entry 394 (class 1259 OID 87332)
-- Dependencies: 11
-- Name: connotacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE connotacion (
    idconnotacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.connotacion OWNER TO postgres;

--
-- TOC entry 9228 (class 0 OID 0)
-- Dependencies: 394
-- Name: TABLE connotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE connotacion IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 9229 (class 0 OID 0)
-- Dependencies: 394
-- Name: COLUMN connotacion.idconnotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion.idconnotacion IS 'Identificador unico de la connotacion.';


--
-- TOC entry 9230 (class 0 OID 0)
-- Dependencies: 394
-- Name: COLUMN connotacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion.descripcion IS 'Descripcion de la connotacion.';


--
-- TOC entry 9231 (class 0 OID 0)
-- Dependencies: 394
-- Name: COLUMN connotacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 395 (class 1259 OID 87335)
-- Dependencies: 11
-- Name: connotacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE connotacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idconnotacion integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.connotacion_audit OWNER TO postgres;

--
-- TOC entry 9232 (class 0 OID 0)
-- Dependencies: 395
-- Name: COLUMN connotacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9233 (class 0 OID 0)
-- Dependencies: 395
-- Name: COLUMN connotacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9234 (class 0 OID 0)
-- Dependencies: 395
-- Name: COLUMN connotacion_audit.idconnotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion_audit.idconnotacion IS 'Identificador unico de la connotacion.';


--
-- TOC entry 9235 (class 0 OID 0)
-- Dependencies: 395
-- Name: COLUMN connotacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion_audit.descripcion IS 'Descripcion de la connotacion.';


--
-- TOC entry 9236 (class 0 OID 0)
-- Dependencies: 395
-- Name: COLUMN connotacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN connotacion_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 396 (class 1259 OID 87338)
-- Dependencies: 394 11
-- Name: connotacion_idconnotacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE connotacion_idconnotacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.connotacion_idconnotacion_seq OWNER TO postgres;

--
-- TOC entry 9237 (class 0 OID 0)
-- Dependencies: 396
-- Name: connotacion_idconnotacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE connotacion_idconnotacion_seq OWNED BY connotacion.idconnotacion;


--
-- TOC entry 397 (class 1259 OID 87340)
-- Dependencies: 11
-- Name: controlregistrohechos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE controlregistrohechos (
    idregistrohecho integer NOT NULL,
    idautoridad integer NOT NULL,
    fecha date NOT NULL,
    observacion text,
    usuarioreceptor character varying(10),
    primernombre character varying(100),
    segundonombre character varying(100),
    primerapellido character varying(100),
    segundoapellido character varying(100),
    cargo character varying(200),
    usuario character varying(10),
    entidad character varying(100),
    conteo integer NOT NULL
);


ALTER TABLE public.controlregistrohechos OWNER TO postgres;

--
-- TOC entry 9238 (class 0 OID 0)
-- Dependencies: 397
-- Name: TABLE controlregistrohechos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE controlregistrohechos IS 'Control registro de hechos';


--
-- TOC entry 9239 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.idregistrohecho IS 'Numero unico identificacion registro del hecho';


--
-- TOC entry 9240 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.idautoridad IS 'Identificacion unica de la autoridad';


--
-- TOC entry 9241 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.fecha IS 'Fecha en la cual se recepciono el formato de hechos';


--
-- TOC entry 9242 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.observacion IS 'Para ingresar en la base de datos';


--
-- TOC entry 9243 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.usuarioreceptor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.usuarioreceptor IS 'La autoridad que recepciono el Formato de Hechos ';


--
-- TOC entry 9244 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.primernombre IS 'Primer Nombre';


--
-- TOC entry 9245 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.segundonombre IS 'Segundo Nombre';


--
-- TOC entry 9246 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.primerapellido IS 'Primer Apellido';


--
-- TOC entry 9247 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.segundoapellido IS 'Segundo Apellido';


--
-- TOC entry 9248 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.cargo IS 'Que cargo posee';


--
-- TOC entry 9249 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 9250 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.entidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.entidad IS 'Nombre de la entidad a la que pertenece el usuario receptor';


--
-- TOC entry 9251 (class 0 OID 0)
-- Dependencies: 397
-- Name: COLUMN controlregistrohechos.conteo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos.conteo IS 'Numero de registros';


--
-- TOC entry 398 (class 1259 OID 87346)
-- Dependencies: 11
-- Name: controlregistrohechos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE controlregistrohechos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idregistrohecho integer NOT NULL,
    idautoridad integer NOT NULL,
    fecha date NOT NULL,
    observacion text,
    usuarioreceptor character varying(10),
    primernombre character varying(100),
    segundonombre character varying(100),
    primerapellido character varying(100),
    segundoapellido character varying(100),
    cargo character varying(200),
    usuario character varying(10),
    entidad character varying(100),
    conteo integer
);


ALTER TABLE public.controlregistrohechos_audit OWNER TO postgres;

--
-- TOC entry 9252 (class 0 OID 0)
-- Dependencies: 398
-- Name: TABLE controlregistrohechos_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE controlregistrohechos_audit IS 'Actualizacion de control registrohechos_audit';


--
-- TOC entry 9253 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9254 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9255 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.idregistrohecho IS 'Numero unico identificacion registro del hecho';


--
-- TOC entry 9256 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.idautoridad IS 'Identificacion unica de la autoridad';


--
-- TOC entry 9257 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.fecha IS 'Fecha en la cual se recepciono el formato de hechos';


--
-- TOC entry 9258 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.observacion IS 'Para ingresar en la base de datos';


--
-- TOC entry 9259 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.usuarioreceptor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.usuarioreceptor IS 'La autoridad que recepciono el Formato de Hechos';


--
-- TOC entry 9260 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.primernombre IS 'Primer Nombre';


--
-- TOC entry 9261 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.segundonombre IS 'Segundo Nombre';


--
-- TOC entry 9262 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.primerapellido IS 'Primer Apellido';


--
-- TOC entry 9263 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.segundoapellido IS 'Segundo Apellido';


--
-- TOC entry 9264 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.cargo IS 'Que cargo posee';


--
-- TOC entry 9265 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 9266 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.entidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.entidad IS 'Nombre de la entidad a la que pertenece el usuario receptor';


--
-- TOC entry 9267 (class 0 OID 0)
-- Dependencies: 398
-- Name: COLUMN controlregistrohechos_audit.conteo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN controlregistrohechos_audit.conteo IS 'Numero de registros';


--
-- TOC entry 399 (class 1259 OID 87352)
-- Dependencies: 397 11
-- Name: controlregistrohechos_conteo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE controlregistrohechos_conteo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.controlregistrohechos_conteo_seq OWNER TO postgres;

--
-- TOC entry 9268 (class 0 OID 0)
-- Dependencies: 399
-- Name: controlregistrohechos_conteo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE controlregistrohechos_conteo_seq OWNED BY controlregistrohechos.conteo;


--
-- TOC entry 400 (class 1259 OID 87354)
-- Dependencies: 11
-- Name: datosbasicos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE datosbasicos (
    nombretabla character varying(200) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.datosbasicos OWNER TO postgres;

--
-- TOC entry 9269 (class 0 OID 0)
-- Dependencies: 400
-- Name: TABLE datosbasicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE datosbasicos IS 'Tabla para administrar las tablas basicas del aplicativo.';


--
-- TOC entry 9270 (class 0 OID 0)
-- Dependencies: 400
-- Name: COLUMN datosbasicos.nombretabla; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos.nombretabla IS 'Nombre de la tabla.';


--
-- TOC entry 9271 (class 0 OID 0)
-- Dependencies: 400
-- Name: COLUMN datosbasicos.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 401 (class 1259 OID 87357)
-- Dependencies: 11
-- Name: datosbasicos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE datosbasicos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    nombretabla character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.datosbasicos_audit OWNER TO postgres;

--
-- TOC entry 9272 (class 0 OID 0)
-- Dependencies: 401
-- Name: TABLE datosbasicos_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE datosbasicos_audit IS 'Tabla para administrar las tablas basicas del aplicativo.';


--
-- TOC entry 9273 (class 0 OID 0)
-- Dependencies: 401
-- Name: COLUMN datosbasicos_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9274 (class 0 OID 0)
-- Dependencies: 401
-- Name: COLUMN datosbasicos_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9275 (class 0 OID 0)
-- Dependencies: 401
-- Name: COLUMN datosbasicos_audit.nombretabla; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos_audit.nombretabla IS 'Nombre de la tabla.';


--
-- TOC entry 9276 (class 0 OID 0)
-- Dependencies: 401
-- Name: COLUMN datosbasicos_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosbasicos_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 402 (class 1259 OID 87360)
-- Dependencies: 11
-- Name: datosconsultaporusuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE datosconsultaporusuario (
    id integer NOT NULL,
    usuario character varying(100) NOT NULL,
    ip character varying(15) NOT NULL,
    fecha timestamp without time zone NOT NULL,
    consulta text NOT NULL
);


ALTER TABLE public.datosconsultaporusuario OWNER TO postgres;

--
-- TOC entry 9277 (class 0 OID 0)
-- Dependencies: 402
-- Name: COLUMN datosconsultaporusuario.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosconsultaporusuario.usuario IS 'Usuario que ejecuta la consulta';


--
-- TOC entry 9278 (class 0 OID 0)
-- Dependencies: 402
-- Name: COLUMN datosconsultaporusuario.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosconsultaporusuario.ip IS 'Direccion IP del usuario que ejecuta la consulta.';


--
-- TOC entry 9279 (class 0 OID 0)
-- Dependencies: 402
-- Name: COLUMN datosconsultaporusuario.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosconsultaporusuario.fecha IS 'Fecha exacta en la que el usuario ejecuta la consulta.';


--
-- TOC entry 9280 (class 0 OID 0)
-- Dependencies: 402
-- Name: COLUMN datosconsultaporusuario.consulta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN datosconsultaporusuario.consulta IS 'SQL de la consulta que ejecuta el usuario.';


--
-- TOC entry 403 (class 1259 OID 87366)
-- Dependencies: 402 11
-- Name: datosconsultaporusuario_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE datosconsultaporusuario_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.datosconsultaporusuario_id_seq OWNER TO postgres;

--
-- TOC entry 9281 (class 0 OID 0)
-- Dependencies: 403
-- Name: datosconsultaporusuario_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE datosconsultaporusuario_id_seq OWNED BY datosconsultaporusuario.id;


--
-- TOC entry 404 (class 1259 OID 87368)
-- Dependencies: 7279 11
-- Name: decisionterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE decisionterminacionprocesopostulado (
    iddecisionterminacion integer NOT NULL,
    idsolicitudterminacion integer NOT NULL,
    decision boolean DEFAULT true NOT NULL,
    fechaaudiencia date NOT NULL,
    fechadecision date NOT NULL,
    despacho integer NOT NULL,
    fiscal character varying(10) NOT NULL,
    idsalaconocimiento integer NOT NULL,
    observacion text NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.decisionterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 405 (class 1259 OID 87375)
-- Dependencies: 7280 11
-- Name: decisionterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE decisionterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddecisionterminacion integer,
    idsolicitudterminacion integer,
    decision boolean DEFAULT true,
    fechaaudiencia date,
    fechadecision date,
    despacho integer,
    fiscal character varying(10),
    idsalaconocimiento integer,
    observacion text,
    usuario character varying(10)
);


ALTER TABLE public.decisionterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 406 (class 1259 OID 87382)
-- Dependencies: 404 11
-- Name: decisionterminacionprocesopostulado_iddecisionterminacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE decisionterminacionprocesopostulado_iddecisionterminacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.decisionterminacionprocesopostulado_iddecisionterminacion_seq OWNER TO postgres;

--
-- TOC entry 9282 (class 0 OID 0)
-- Dependencies: 406
-- Name: decisionterminacionprocesopostulado_iddecisionterminacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE decisionterminacionprocesopostulado_iddecisionterminacion_seq OWNED BY decisionterminacionprocesopostulado.iddecisionterminacion;


--
-- TOC entry 407 (class 1259 OID 87384)
-- Dependencies: 11
-- Name: delito_iddelito_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE delito_iddelito_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.delito_iddelito_seq OWNER TO postgres;

--
-- TOC entry 408 (class 1259 OID 87386)
-- Dependencies: 7281 11
-- Name: delito; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE delito (
    iddelito integer DEFAULT nextval('delito_iddelito_seq'::regclass) NOT NULL,
    nombredelito character varying(200) NOT NULL,
    usuario character varying(10),
    idsubtipodelito integer
);


ALTER TABLE public.delito OWNER TO postgres;

--
-- TOC entry 9283 (class 0 OID 0)
-- Dependencies: 408
-- Name: TABLE delito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE delito IS 'Tabla del tipo de delito';


--
-- TOC entry 9284 (class 0 OID 0)
-- Dependencies: 408
-- Name: COLUMN delito.iddelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito.iddelito IS 'Identificacion del delito';


--
-- TOC entry 9285 (class 0 OID 0)
-- Dependencies: 408
-- Name: COLUMN delito.nombredelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito.nombredelito IS 'Nombre del delito';


--
-- TOC entry 9286 (class 0 OID 0)
-- Dependencies: 408
-- Name: COLUMN delito.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito.usuario IS 'Usuario que accede al sistema y crea el registro';


--
-- TOC entry 409 (class 1259 OID 87390)
-- Dependencies: 11
-- Name: delito_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE delito_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddelito integer NOT NULL,
    nombredelito character varying(200) NOT NULL,
    usuario character varying(10),
    idsubtipodelito integer
);


ALTER TABLE public.delito_audit OWNER TO postgres;

--
-- TOC entry 9287 (class 0 OID 0)
-- Dependencies: 409
-- Name: TABLE delito_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE delito_audit IS 'Tabla de actualizacion del tipo de delito';


--
-- TOC entry 9288 (class 0 OID 0)
-- Dependencies: 409
-- Name: COLUMN delito_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9289 (class 0 OID 0)
-- Dependencies: 409
-- Name: COLUMN delito_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9290 (class 0 OID 0)
-- Dependencies: 409
-- Name: COLUMN delito_audit.iddelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito_audit.iddelito IS 'Identificacion del delito';


--
-- TOC entry 9291 (class 0 OID 0)
-- Dependencies: 409
-- Name: COLUMN delito_audit.nombredelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito_audit.nombredelito IS 'Nombre del delito';


--
-- TOC entry 9292 (class 0 OID 0)
-- Dependencies: 409
-- Name: COLUMN delito_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN delito_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 410 (class 1259 OID 87393)
-- Dependencies: 11
-- Name: denunciaadicional; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE denunciaadicional (
    idautoridad integer NOT NULL,
    idevento character varying(50) NOT NULL,
    fecha date NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.denunciaadicional OWNER TO postgres;

--
-- TOC entry 9293 (class 0 OID 0)
-- Dependencies: 410
-- Name: TABLE denunciaadicional; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE denunciaadicional IS 'tabla denuncia adicional';


--
-- TOC entry 9294 (class 0 OID 0)
-- Dependencies: 410
-- Name: COLUMN denunciaadicional.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional.idautoridad IS 'Identificacion unica de la autoridad';


--
-- TOC entry 9295 (class 0 OID 0)
-- Dependencies: 410
-- Name: COLUMN denunciaadicional.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional.idevento IS 'Identificacion unica del evento';


--
-- TOC entry 9296 (class 0 OID 0)
-- Dependencies: 410
-- Name: COLUMN denunciaadicional.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional.fecha IS 'fecha del evento';


--
-- TOC entry 9297 (class 0 OID 0)
-- Dependencies: 410
-- Name: COLUMN denunciaadicional.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 411 (class 1259 OID 87396)
-- Dependencies: 11
-- Name: denunciaadicional_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE denunciaadicional_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idautoridad integer NOT NULL,
    idevento character varying(50) NOT NULL,
    fecha date NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.denunciaadicional_audit OWNER TO postgres;

--
-- TOC entry 9298 (class 0 OID 0)
-- Dependencies: 411
-- Name: TABLE denunciaadicional_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE denunciaadicional_audit IS 'Actualizacion y modificacion tabla denuncia adicional';


--
-- TOC entry 9299 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar -D
Actualizar -X Y U
Como estaba -X
Como Quedo -U
Bajo descripcion del PostgresSQL';


--
-- TOC entry 9300 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9301 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.idautoridad IS 'Identificacion unica de la autoridad';


--
-- TOC entry 9302 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.idevento IS 'Identificacion unica del evento';


--
-- TOC entry 9303 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.fecha IS 'fecha del evento';


--
-- TOC entry 9304 (class 0 OID 0)
-- Dependencies: 411
-- Name: COLUMN denunciaadicional_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN denunciaadicional_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 414 (class 1259 OID 87405)
-- Dependencies: 11
-- Name: desmovilizacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE desmovilizacion (
    iddesmovilizacion integer NOT NULL,
    nombredesmovilizacion character varying(100) NOT NULL,
    fechadesmovilizacion date,
    cantidad integer,
    idpais integer NOT NULL,
    iddepartamento integer NOT NULL,
    idmunicipio integer NOT NULL,
    idclasedesmovilizacion integer,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    idgrupoarmado integer NOT NULL,
    corregimiento character varying(100),
    vereda character varying(100),
    usuario character varying(10),
    inspeccion character(100),
    finca character(100),
    sitio character(100),
    idmiembrorepresentante integer
);


ALTER TABLE public.desmovilizacion OWNER TO postgres;

--
-- TOC entry 9305 (class 0 OID 0)
-- Dependencies: 414
-- Name: TABLE desmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE desmovilizacion IS 'Tabla desmovilizacion';


--
-- TOC entry 9306 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.iddesmovilizacion IS 'identificacion unica de desmovilizacion';


--
-- TOC entry 9307 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.nombredesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.nombredesmovilizacion IS 'Nombre del bloque de desmovilizacion';


--
-- TOC entry 9308 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.fechadesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.fechadesmovilizacion IS 'Fecha desmovilizacion';


--
-- TOC entry 9309 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.cantidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.cantidad IS 'cantidad de desmovilizados';


--
-- TOC entry 9310 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idpais IS 'Identificacion del pais';


--
-- TOC entry 9311 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9312 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9313 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idclasedesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idclasedesmovilizacion IS 'Identificacion clase desmovilizacion';


--
-- TOC entry 9314 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idestructura IS 'Identificacion de la estructura';


--
-- TOC entry 9315 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idbloque IS 'Identificacion del bloque';


--
-- TOC entry 9316 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idfrente IS 'Identificacion del frente';


--
-- TOC entry 9317 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.idgrupoarmado IS 'Identificacion del grupo armado';


--
-- TOC entry 9318 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.corregimiento IS 'Nombre del corregimiento';


--
-- TOC entry 9319 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.vereda IS 'Nombre de la vereda';


--
-- TOC entry 9320 (class 0 OID 0)
-- Dependencies: 414
-- Name: COLUMN desmovilizacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 415 (class 1259 OID 87408)
-- Dependencies: 11
-- Name: desmovilizacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE desmovilizacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddesmovilizacion integer NOT NULL,
    nombredesmovilizacion character varying(100) NOT NULL,
    fechadesmovilizacion date,
    cantidad integer,
    idpais integer NOT NULL,
    iddepartamento integer NOT NULL,
    idmunicipio integer NOT NULL,
    idclasedesmovilizacion integer,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    idgrupoarmado integer NOT NULL,
    corregimiento character varying(100),
    vereda character varying(100),
    usuario character varying(10),
    inspeccion character(100),
    finca character(100),
    sitio character(100),
    idmiembrorepresentante integer
);


ALTER TABLE public.desmovilizacion_audit OWNER TO postgres;

--
-- TOC entry 9321 (class 0 OID 0)
-- Dependencies: 415
-- Name: TABLE desmovilizacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE desmovilizacion_audit IS 'Tabla desmovilizacion';


--
-- TOC entry 9322 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertai -I
Borrar -D
Actualizar -X y U
Como estaba -X
Como quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9323 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9324 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.iddesmovilizacion IS 'identificacion unica de desmovilizacion';


--
-- TOC entry 9325 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.nombredesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.nombredesmovilizacion IS 'Nombre del bloque de desmovilizacion';


--
-- TOC entry 9326 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.fechadesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.fechadesmovilizacion IS 'Fecha desmovilizacion';


--
-- TOC entry 9327 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.cantidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.cantidad IS 'cantidad de desmovilizados''';


--
-- TOC entry 9328 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idpais IS 'Identificacion del pais';


--
-- TOC entry 9329 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9330 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9331 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idclasedesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idclasedesmovilizacion IS 'Identificacion clase desmovilizacion';


--
-- TOC entry 9332 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idestructura IS 'Identificacion de la estructura';


--
-- TOC entry 9333 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idbloque IS 'Identificacion del bloque';


--
-- TOC entry 9334 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idfrente IS 'Identificacion del frente';


--
-- TOC entry 9335 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.idgrupoarmado IS 'Identificacion del grupo armado';


--
-- TOC entry 9336 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.corregimiento IS 'Nombre del corregimiento';


--
-- TOC entry 9337 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.vereda IS 'Nombre de la vereda';


--
-- TOC entry 9338 (class 0 OID 0)
-- Dependencies: 415
-- Name: COLUMN desmovilizacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizacion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 416 (class 1259 OID 87414)
-- Dependencies: 414 11
-- Name: desmovilizacion_iddesmovilizacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE desmovilizacion_iddesmovilizacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.desmovilizacion_iddesmovilizacion_seq OWNER TO postgres;

--
-- TOC entry 9339 (class 0 OID 0)
-- Dependencies: 416
-- Name: desmovilizacion_iddesmovilizacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE desmovilizacion_iddesmovilizacion_seq OWNED BY desmovilizacion.iddesmovilizacion;


--
-- TOC entry 417 (class 1259 OID 87416)
-- Dependencies: 11
-- Name: desmovilizado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE desmovilizado (
    idpersona integer NOT NULL,
    iddesmovilizacion integer NOT NULL,
    idpaisdesmovilizacion integer NOT NULL,
    vereda character varying(100),
    corregimiento character varying(100),
    iddepartamentodesmovilizacion integer,
    idmunicipiodesmovilizacion integer,
    usuario character varying(10),
    inspeccion character(100),
    finca character(100),
    sitio character(100)
);


ALTER TABLE public.desmovilizado OWNER TO postgres;

--
-- TOC entry 9340 (class 0 OID 0)
-- Dependencies: 417
-- Name: TABLE desmovilizado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE desmovilizado IS 'Tabla de identificacion del desmovilizado';


--
-- TOC entry 9341 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9342 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.iddesmovilizacion IS 'identificacion unica de desmovilizacion';


--
-- TOC entry 9343 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.idpaisdesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.idpaisdesmovilizacion IS 'identificacion del pais de desmovilizacion';


--
-- TOC entry 9344 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.iddepartamentodesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.iddepartamentodesmovilizacion IS 'Identificacion departamento desmovilizacion';


--
-- TOC entry 9345 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.idmunicipiodesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.idmunicipiodesmovilizacion IS 'identificaion municipio de desmovilizado';


--
-- TOC entry 9346 (class 0 OID 0)
-- Dependencies: 417
-- Name: COLUMN desmovilizado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 418 (class 1259 OID 87419)
-- Dependencies: 11
-- Name: desmovilizado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE desmovilizado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersona integer NOT NULL,
    iddesmovilizacion integer NOT NULL,
    idpaisdesmovilizacion integer NOT NULL,
    vereda character varying(100),
    corregimiento character varying(100),
    iddepartamentodesmovilizacion integer,
    idmunicipiodesmovilizacion integer,
    usuario character varying(10),
    inspeccion character(100),
    finca character(100),
    sitio character(100)
);


ALTER TABLE public.desmovilizado_audit OWNER TO postgres;

--
-- TOC entry 9347 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9348 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9349 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9350 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.iddesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.iddesmovilizacion IS 'identificacion unica de desmovilizacion';


--
-- TOC entry 9351 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.idpaisdesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.idpaisdesmovilizacion IS 'identificacion del pais de desmovilizacion';


--
-- TOC entry 9352 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.iddepartamentodesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.iddepartamentodesmovilizacion IS 'Identificacion departamento desmovilizacion';


--
-- TOC entry 9353 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.idmunicipiodesmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.idmunicipiodesmovilizacion IS 'identificaion municipio de desmovilizado';


--
-- TOC entry 9354 (class 0 OID 0)
-- Dependencies: 418
-- Name: COLUMN desmovilizado_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN desmovilizado_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 419 (class 1259 OID 87422)
-- Dependencies: 7285 11
-- Name: despacho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE despacho (
    iddespacho integer NOT NULL,
    escabeza smallint DEFAULT 0 NOT NULL,
    descripcion character varying(100) NOT NULL,
    municipio integer NOT NULL,
    direccion character varying(200) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.despacho OWNER TO postgres;

--
-- TOC entry 9355 (class 0 OID 0)
-- Dependencies: 419
-- Name: TABLE despacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE despacho IS 'Tabla que administra Despachos.';


--
-- TOC entry 9356 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.iddespacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.iddespacho IS 'Identificador unico del despacho.';


--
-- TOC entry 9357 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.escabeza; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.escabeza IS 'Dice si es padre de algun otro despacho. 0 -> Si, 1 -> No.';


--
-- TOC entry 9358 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.descripcion IS 'Descripcion del despacho.';


--
-- TOC entry 9359 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.municipio IS 'Municipio de ubicacion del despacho.';


--
-- TOC entry 9360 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.direccion IS 'Direccion de ubicacion del despacho.';


--
-- TOC entry 9361 (class 0 OID 0)
-- Dependencies: 419
-- Name: COLUMN despacho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN despacho.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 420 (class 1259 OID 87426)
-- Dependencies: 11
-- Name: despacho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE despacho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddespacho integer,
    escabeza smallint,
    descripcion character varying(100),
    municipio integer,
    direccion character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.despacho_audit OWNER TO postgres;

--
-- TOC entry 421 (class 1259 OID 87429)
-- Dependencies: 419 11
-- Name: despacho_iddespacho_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE despacho_iddespacho_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.despacho_iddespacho_seq OWNER TO postgres;

--
-- TOC entry 9362 (class 0 OID 0)
-- Dependencies: 421
-- Name: despacho_iddespacho_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE despacho_iddespacho_seq OWNED BY despacho.iddespacho;


--
-- TOC entry 422 (class 1259 OID 87431)
-- Dependencies: 11
-- Name: documento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documento (
    iddocumento integer NOT NULL,
    idtipodocumento integer NOT NULL,
    idautoridad integer,
    entidad character varying(100) NOT NULL,
    numero character varying(20) NOT NULL,
    fecha date NOT NULL,
    primernombre character varying(100),
    segundonombre character varying(100),
    primerapellido character varying(100),
    segundoapellido character varying(100),
    usuariofirma character varying(10),
    observaciones text NOT NULL,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.documento OWNER TO postgres;

--
-- TOC entry 9363 (class 0 OID 0)
-- Dependencies: 422
-- Name: TABLE documento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documento IS 'Documentos.';


--
-- TOC entry 9364 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.iddocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.iddocumento IS 'Numero unico de documento.';


--
-- TOC entry 9365 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.idtipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.idtipodocumento IS 'Tipo de documento.';


--
-- TOC entry 9366 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.idautoridad IS 'Autoridad.';


--
-- TOC entry 9367 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.entidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.entidad IS 'Nombre de la entidad.';


--
-- TOC entry 9368 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.numero IS 'Numero del documento';


--
-- TOC entry 9369 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.fecha IS 'Fecha del documento';


--
-- TOC entry 9370 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.primernombre IS 'Primer nombre de quien firma el documento.';


--
-- TOC entry 9371 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.segundonombre IS 'Segundo nombre de quien firma el documento.';


--
-- TOC entry 9372 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.primerapellido IS 'Primer apellido de quien firma el documento.';


--
-- TOC entry 9373 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.segundoapellido IS 'Segundo apellido de quien firma el documento.';


--
-- TOC entry 9374 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.usuariofirma; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.usuariofirma IS 'Usuario de quien firma el documento.';


--
-- TOC entry 9375 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.observaciones; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.observaciones IS 'Observaciones al documento.';


--
-- TOC entry 9376 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.idpais IS 'Pais donde se firma el documento.';


--
-- TOC entry 9377 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.iddepartamento IS 'Departamento donde se firma el documento.';


--
-- TOC entry 9378 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.idmunicipio IS 'Municipio donde se firma el documento.';


--
-- TOC entry 9379 (class 0 OID 0)
-- Dependencies: 422
-- Name: COLUMN documento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 423 (class 1259 OID 87437)
-- Dependencies: 11
-- Name: documento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumento integer,
    idtipodocumento integer,
    idautoridad integer,
    entidad character varying(100),
    numero character varying(20),
    fecha date,
    primernombre character varying(100),
    segundonombre character varying(100),
    primerapellido character varying(100),
    segundoapellido character varying(100),
    usuariofirma character varying(10),
    observaciones text,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    usuario character varying(10)
);


ALTER TABLE public.documento_audit OWNER TO postgres;

--
-- TOC entry 9380 (class 0 OID 0)
-- Dependencies: 423
-- Name: TABLE documento_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documento_audit IS 'Documentos.';


--
-- TOC entry 9381 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9382 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9383 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.iddocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.iddocumento IS 'Numero unico de documento.';


--
-- TOC entry 9384 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.idtipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.idtipodocumento IS 'Tipo de documento.';


--
-- TOC entry 9385 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.idautoridad IS 'Autoridad.';


--
-- TOC entry 9386 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.entidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.entidad IS 'Nombre de la entidad.';


--
-- TOC entry 9387 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.numero IS 'Numero del documento';


--
-- TOC entry 9388 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.fecha IS 'Fecha del documento';


--
-- TOC entry 9389 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.primernombre IS 'Primer nombre de quien firma el documento.';


--
-- TOC entry 9390 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.segundonombre IS 'Segundo nombre de quien firma el documento.';


--
-- TOC entry 9391 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.primerapellido IS 'Primer apellido de quien firma el documento.';


--
-- TOC entry 9392 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.segundoapellido IS 'Segundo apellido de quien firma el documento.';


--
-- TOC entry 9393 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.usuariofirma; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.usuariofirma IS 'Usuario de quien firma el documento.';


--
-- TOC entry 9394 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.observaciones; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.observaciones IS 'Observaciones al documento.';


--
-- TOC entry 9395 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.idpais IS 'Pais donde se firma el documento.';


--
-- TOC entry 9396 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.iddepartamento IS 'Departamento donde se firma el documento.';


--
-- TOC entry 9397 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.idmunicipio IS 'Municipio donde se firma el documento.';


--
-- TOC entry 9398 (class 0 OID 0)
-- Dependencies: 423
-- Name: COLUMN documento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documento_audit.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 424 (class 1259 OID 87443)
-- Dependencies: 422 11
-- Name: documento_iddocumento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documento_iddocumento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documento_iddocumento_seq OWNER TO postgres;

--
-- TOC entry 9399 (class 0 OID 0)
-- Dependencies: 424
-- Name: documento_iddocumento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documento_iddocumento_seq OWNED BY documento.iddocumento;


--
-- TOC entry 425 (class 1259 OID 87445)
-- Dependencies: 11
-- Name: documentocarpeta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentocarpeta (
    iddocumentocarpeta integer NOT NULL,
    idtipodocumentocarpeta integer NOT NULL,
    numero character varying(100),
    fecha date,
    nombrearchivo character varying(100),
    usuario character varying(10) NOT NULL,
    numfolio integer,
    observacion text,
    idcarpeta integer NOT NULL
);


ALTER TABLE public.documentocarpeta OWNER TO postgres;

--
-- TOC entry 9400 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.iddocumentocarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.iddocumentocarpeta IS 'Identificador unico para el documento de carperta.';


--
-- TOC entry 9401 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.idtipodocumentocarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.idtipodocumentocarpeta IS 'Identificador unico del tipo de documento de carperta.';


--
-- TOC entry 9402 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.numero IS 'numero del documento del carperta.';


--
-- TOC entry 9403 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.fecha IS 'fecha del documento de carperta.';


--
-- TOC entry 9404 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.nombrearchivo IS 'nombre del archivo.';


--
-- TOC entry 9405 (class 0 OID 0)
-- Dependencies: 425
-- Name: COLUMN documentocarpeta.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocarpeta.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 426 (class 1259 OID 87451)
-- Dependencies: 11
-- Name: documentocarpeta_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentocarpeta_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentocarpeta integer,
    idtipodocumentocarpeta integer,
    numero character varying(100),
    fecha timestamp without time zone,
    nombrearchivo character varying(100),
    usuario character varying(10),
    numfolio integer,
    observacion text,
    idcarpeta integer NOT NULL
);


ALTER TABLE public.documentocarpeta_audit OWNER TO postgres;

--
-- TOC entry 427 (class 1259 OID 87457)
-- Dependencies: 425 11
-- Name: documentocarpeta_iddocumentocarpeta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentocarpeta_iddocumentocarpeta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentocarpeta_iddocumentocarpeta_seq OWNER TO postgres;

--
-- TOC entry 9406 (class 0 OID 0)
-- Dependencies: 427
-- Name: documentocarpeta_iddocumentocarpeta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentocarpeta_iddocumentocarpeta_seq OWNED BY documentocarpeta.iddocumentocarpeta;


--
-- TOC entry 428 (class 1259 OID 87459)
-- Dependencies: 11
-- Name: documentocompulsacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentocompulsacion (
    iddocumentocompulsacion integer NOT NULL,
    iddespacho integer,
    idcompulsacion integer,
    idtipodocumentocompulsacion integer,
    fechaoficio date,
    numerooficio character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.documentocompulsacion OWNER TO postgres;

--
-- TOC entry 9407 (class 0 OID 0)
-- Dependencies: 428
-- Name: TABLE documentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documentocompulsacion IS 'Documento asociado a la compulsacion.';


--
-- TOC entry 9408 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.iddocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.iddocumentocompulsacion IS 'Identificador unico del documento de la compulsacion.';


--
-- TOC entry 9409 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.iddespacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.iddespacho IS 'Identificador que relaciona el despacho con el documento para saber su origen.';


--
-- TOC entry 9410 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.idcompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.idcompulsacion IS 'Identificador de la compulsacion a la que pretenece el documento.';


--
-- TOC entry 9411 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.idtipodocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.idtipodocumentocompulsacion IS 'Relacion del tipo de documento asociado a la compulsacion.';


--
-- TOC entry 9412 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.fechaoficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.fechaoficio IS 'Fecha del documento relacionado.';


--
-- TOC entry 9413 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.numerooficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.numerooficio IS 'Numero especifico del oficio relacionado.';


--
-- TOC entry 9414 (class 0 OID 0)
-- Dependencies: 428
-- Name: COLUMN documentocompulsacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 429 (class 1259 OID 87462)
-- Dependencies: 11
-- Name: documentocompulsacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentocompulsacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentocompulsacion integer NOT NULL,
    idtipodocumentocompulsacion integer,
    iddespacho integer,
    idcompulsacion integer,
    fechaoficio date,
    numerooficio character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.documentocompulsacion_audit OWNER TO postgres;

--
-- TOC entry 9415 (class 0 OID 0)
-- Dependencies: 429
-- Name: TABLE documentocompulsacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documentocompulsacion_audit IS 'Control del documento asociado a la compulsacion.';


--
-- TOC entry 9416 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 9417 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 9418 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.iddocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.iddocumentocompulsacion IS 'Identificador unico del documento de la compulsacion.';


--
-- TOC entry 9419 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.idtipodocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.idtipodocumentocompulsacion IS 'Relacion del tipo de documento asociado a la compulsacion.';


--
-- TOC entry 9420 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.iddespacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.iddespacho IS 'Identificador que relaciona el despacho con el documento para saber su origen.';


--
-- TOC entry 9421 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.idcompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.idcompulsacion IS 'Identificador de la compulsacion a la que pretenece el documento.';


--
-- TOC entry 9422 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.fechaoficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.fechaoficio IS 'Fecha del documento relacionado.';


--
-- TOC entry 9423 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.numerooficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.numerooficio IS 'Numero especifico del oficio relacionado.';


--
-- TOC entry 9424 (class 0 OID 0)
-- Dependencies: 429
-- Name: COLUMN documentocompulsacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentocompulsacion_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 430 (class 1259 OID 87465)
-- Dependencies: 429 11
-- Name: documentocompulsacion_audit_iddocumentocompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentocompulsacion_audit_iddocumentocompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentocompulsacion_audit_iddocumentocompulsacion_seq OWNER TO postgres;

--
-- TOC entry 9425 (class 0 OID 0)
-- Dependencies: 430
-- Name: documentocompulsacion_audit_iddocumentocompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentocompulsacion_audit_iddocumentocompulsacion_seq OWNED BY documentocompulsacion_audit.iddocumentocompulsacion;


--
-- TOC entry 431 (class 1259 OID 87467)
-- Dependencies: 428 11
-- Name: documentocompulsacion_iddocumentocompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentocompulsacion_iddocumentocompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentocompulsacion_iddocumentocompulsacion_seq OWNER TO postgres;

--
-- TOC entry 9426 (class 0 OID 0)
-- Dependencies: 431
-- Name: documentocompulsacion_iddocumentocompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentocompulsacion_iddocumentocompulsacion_seq OWNED BY documentocompulsacion.iddocumentocompulsacion;


--
-- TOC entry 432 (class 1259 OID 87469)
-- Dependencies: 7291 11
-- Name: documentocuerpotipoacta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentocuerpotipoacta (
    iddocumentocuerpotipoacta integer NOT NULL,
    idtipoactaasignacion integer NOT NULL,
    parrafo text NOT NULL,
    orden integer NOT NULL,
    antesdelista boolean DEFAULT false NOT NULL
);


ALTER TABLE public.documentocuerpotipoacta OWNER TO postgres;

--
-- TOC entry 433 (class 1259 OID 87476)
-- Dependencies: 432 11
-- Name: documentocuerpotipoacta_iddocumentocuerpotipoacta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentocuerpotipoacta_iddocumentocuerpotipoacta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentocuerpotipoacta_iddocumentocuerpotipoacta_seq OWNER TO postgres;

--
-- TOC entry 9427 (class 0 OID 0)
-- Dependencies: 433
-- Name: documentocuerpotipoacta_iddocumentocuerpotipoacta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentocuerpotipoacta_iddocumentocuerpotipoacta_seq OWNED BY documentocuerpotipoacta.iddocumentocuerpotipoacta;


--
-- TOC entry 434 (class 1259 OID 87478)
-- Dependencies: 11
-- Name: documentoedictoemplazatorio; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentoedictoemplazatorio (
    iddocumentoedictoemplazatorio integer NOT NULL,
    idtipodocumentoedictoemplazatorio integer NOT NULL,
    numero character varying(25) NOT NULL,
    fecha date NOT NULL,
    activo boolean NOT NULL,
    archivo character varying(250),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.documentoedictoemplazatorio OWNER TO postgres;

--
-- TOC entry 435 (class 1259 OID 87481)
-- Dependencies: 11
-- Name: documentoedictoemplazatorio_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentoedictoemplazatorio_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentoedictoemplazatorio integer,
    idtipodocumentoedictoemplazatorio integer,
    numero character varying(25),
    fecha date,
    activo boolean,
    archivo character varying(250),
    usuario character varying(10)
);


ALTER TABLE public.documentoedictoemplazatorio_audit OWNER TO postgres;

--
-- TOC entry 436 (class 1259 OID 87484)
-- Dependencies: 434 11
-- Name: documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq OWNER TO postgres;

--
-- TOC entry 9428 (class 0 OID 0)
-- Dependencies: 436
-- Name: documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq OWNED BY documentoedictoemplazatorio.iddocumentoedictoemplazatorio;


--
-- TOC entry 437 (class 1259 OID 87486)
-- Dependencies: 7294 11
-- Name: documentopersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentopersona (
    iddocumentopersona integer NOT NULL,
    idtipodocumentopersona integer NOT NULL,
    idpersona integer NOT NULL,
    numero character varying(100) DEFAULT 'N/A'::character varying NOT NULL,
    fecha date,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    usuario character varying(10) NOT NULL,
    nombrearchivo character varying(250),
    archivo bytea,
    descripcion character varying(250),
    ip character varying(15)
);


ALTER TABLE public.documentopersona OWNER TO postgres;

--
-- TOC entry 9429 (class 0 OID 0)
-- Dependencies: 437
-- Name: TABLE documentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documentopersona IS 'Lista de documentos que tiene una persona.';


--
-- TOC entry 9430 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.iddocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.iddocumentopersona IS 'Identificador unico del documento de la persona.';


--
-- TOC entry 9431 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.idtipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.idtipodocumentopersona IS 'Tipo de documento de persona.';


--
-- TOC entry 9432 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.idpersona IS 'Persona.';


--
-- TOC entry 9433 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.numero IS 'Numero del docuemento de la persona.';


--
-- TOC entry 9434 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.fecha IS 'fecha de expedicion del documento.';


--
-- TOC entry 9435 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.idpais IS 'Pais de expedicion del documento.';


--
-- TOC entry 9436 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.iddepartamento IS 'Departamento de expedicion del documento.';


--
-- TOC entry 9437 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.idmunicipio IS 'Municipio de expedicion del documento.';


--
-- TOC entry 9438 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.usuario IS 'Ultimo usuario que realizo la actualizacion.';


--
-- TOC entry 9439 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.nombrearchivo IS 'Nombre del archivo.';


--
-- TOC entry 9440 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.archivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.archivo IS 'Archivo.';


--
-- TOC entry 9441 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.descripcion IS 'Descripcion del archivo.';


--
-- TOC entry 9442 (class 0 OID 0)
-- Dependencies: 437
-- Name: COLUMN documentopersona.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona.ip IS 'Ip de ultima accion.';


--
-- TOC entry 438 (class 1259 OID 87493)
-- Dependencies: 11
-- Name: documentopersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentopersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentopersona integer,
    idtipodocumentopersona integer,
    idpersona integer,
    numero character varying(100),
    fecha date,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    usuario character varying(10),
    nombrearchivo character varying(250),
    archivo bytea,
    descripcion character varying(250),
    ip character varying(15)
);


ALTER TABLE public.documentopersona_audit OWNER TO postgres;

--
-- TOC entry 9443 (class 0 OID 0)
-- Dependencies: 438
-- Name: TABLE documentopersona_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE documentopersona_audit IS 'Actualizacion y modificacion de lista de documentos que tiene una persona.
';


--
-- TOC entry 9444 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9445 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9446 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.iddocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.iddocumentopersona IS 'Identificador unico del documento de la persona.';


--
-- TOC entry 9447 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.idtipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.idtipodocumentopersona IS 'Tipo de documento de persona.';


--
-- TOC entry 9448 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.idpersona IS 'Persona.';


--
-- TOC entry 9449 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.numero IS 'Numero del docuemento de la persona.';


--
-- TOC entry 9450 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.fecha IS 'fecha de expedicion del documento.';


--
-- TOC entry 9451 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.idpais IS 'Pais de expedicion del documento.';


--
-- TOC entry 9452 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.iddepartamento IS 'Departamento de expedicion del documento.';


--
-- TOC entry 9453 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.idmunicipio IS 'Municipio de expedicion del documento.';


--
-- TOC entry 9454 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.usuario IS 'Ultimo usuario que realizo la actualizacion.';


--
-- TOC entry 9455 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.nombrearchivo IS 'Nombre del archivo.';


--
-- TOC entry 9456 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.archivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.archivo IS 'Archivo.';


--
-- TOC entry 9457 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.descripcion IS 'Descripcion del archivo.';


--
-- TOC entry 9458 (class 0 OID 0)
-- Dependencies: 438
-- Name: COLUMN documentopersona_audit.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopersona_audit.ip IS 'Ip de ultima accion.';


--
-- TOC entry 439 (class 1259 OID 87499)
-- Dependencies: 437 11
-- Name: documentopersona_iddocumentopersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentopersona_iddocumentopersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentopersona_iddocumentopersona_seq OWNER TO postgres;

--
-- TOC entry 9459 (class 0 OID 0)
-- Dependencies: 439
-- Name: documentopersona_iddocumentopersona_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentopersona_iddocumentopersona_seq OWNED BY documentopersona.iddocumentopersona;


--
-- TOC entry 440 (class 1259 OID 87501)
-- Dependencies: 11
-- Name: documentopostulacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentopostulacion (
    iddocumentopostulacion integer NOT NULL,
    idtipodocumentopostulacion integer NOT NULL,
    numero character varying(100),
    fecha date,
    nombrearchivo character varying(100),
    usuario character varying(10) NOT NULL,
    numfolio integer,
    observacion text
);


ALTER TABLE public.documentopostulacion OWNER TO postgres;

--
-- TOC entry 9460 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.iddocumentopostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.iddocumentopostulacion IS 'Identificador unico para el documento de postulacion.';


--
-- TOC entry 9461 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.idtipodocumentopostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.idtipodocumentopostulacion IS 'Identificador unico del tipo de documento de postulacion.';


--
-- TOC entry 9462 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.numero IS 'numero del documento del postulacion.';


--
-- TOC entry 9463 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.fecha IS 'fecha del documento de postulacion.';


--
-- TOC entry 9464 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.nombrearchivo IS 'nombre del archivo.';


--
-- TOC entry 9465 (class 0 OID 0)
-- Dependencies: 440
-- Name: COLUMN documentopostulacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentopostulacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 441 (class 1259 OID 87507)
-- Dependencies: 11
-- Name: documentopostulacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentopostulacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentopostulacion integer,
    idtipodocumentopostulacion integer,
    numero character varying(100),
    fecha timestamp without time zone,
    nombrearchivo character varying(100),
    usuario character varying(10),
    numfolio integer,
    observacion text
);


ALTER TABLE public.documentopostulacion_audit OWNER TO postgres;

--
-- TOC entry 442 (class 1259 OID 87513)
-- Dependencies: 440 11
-- Name: documentopostulacion_iddocumentopostulacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentopostulacion_iddocumentopostulacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentopostulacion_iddocumentopostulacion_seq OWNER TO postgres;

--
-- TOC entry 9466 (class 0 OID 0)
-- Dependencies: 442
-- Name: documentopostulacion_iddocumentopostulacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentopostulacion_iddocumentopostulacion_seq OWNED BY documentopostulacion.iddocumentopostulacion;


--
-- TOC entry 443 (class 1259 OID 87515)
-- Dependencies: 11
-- Name: documentospostulacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentospostulacion (
    iddocumentospostulacion integer NOT NULL,
    numero character varying(100) NOT NULL,
    fecha date NOT NULL,
    fecharecepcion date NOT NULL,
    archivo character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.documentospostulacion OWNER TO postgres;

--
-- TOC entry 9467 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.iddocumentospostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.iddocumentospostulacion IS 'Identificador unico para el documento de postulacion.';


--
-- TOC entry 9468 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.numero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.numero IS 'numero del documento de la postulacion.';


--
-- TOC entry 9469 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.fecha IS 'fecha del documento de postulacion.';


--
-- TOC entry 9470 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.fecharecepcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.fecharecepcion IS 'fecha de recepcion del archivo';


--
-- TOC entry 9471 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.archivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.archivo IS 'nombre del archivo.';


--
-- TOC entry 9472 (class 0 OID 0)
-- Dependencies: 443
-- Name: COLUMN documentospostulacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN documentospostulacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 444 (class 1259 OID 87518)
-- Dependencies: 11
-- Name: documentospostulacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentospostulacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentospostulacion integer,
    numero character varying(100),
    fecha date,
    fecharecepcion date,
    archivo character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.documentospostulacion_audit OWNER TO postgres;

--
-- TOC entry 445 (class 1259 OID 87521)
-- Dependencies: 443 11
-- Name: documentospostulacion_iddocumentospostulacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentospostulacion_iddocumentospostulacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentospostulacion_iddocumentospostulacion_seq OWNER TO postgres;

--
-- TOC entry 9473 (class 0 OID 0)
-- Dependencies: 445
-- Name: documentospostulacion_iddocumentospostulacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentospostulacion_iddocumentospostulacion_seq OWNED BY documentospostulacion.iddocumentospostulacion;


--
-- TOC entry 446 (class 1259 OID 87523)
-- Dependencies: 11
-- Name: documentotipoacta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documentotipoacta (
    iddocumentoacta integer NOT NULL,
    idtipoactaasignacion integer NOT NULL,
    documento text NOT NULL,
    orden integer NOT NULL
);


ALTER TABLE public.documentotipoacta OWNER TO postgres;

--
-- TOC entry 447 (class 1259 OID 87529)
-- Dependencies: 446 11
-- Name: documentotipoacta_iddocumentoacta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documentotipoacta_iddocumentoacta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentotipoacta_iddocumentoacta_seq OWNER TO postgres;

--
-- TOC entry 9474 (class 0 OID 0)
-- Dependencies: 447
-- Name: documentotipoacta_iddocumentoacta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documentotipoacta_iddocumentoacta_seq OWNED BY documentotipoacta.iddocumentoacta;


--
-- TOC entry 448 (class 1259 OID 87531)
-- Dependencies: 11
-- Name: elemento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE elemento (
    idelemento integer NOT NULL,
    descripcion character varying(100),
    idtipobien integer
);


ALTER TABLE public.elemento OWNER TO postgres;

--
-- TOC entry 9475 (class 0 OID 0)
-- Dependencies: 448
-- Name: TABLE elemento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE elemento IS 'Tabla tipo de elemento ';


--
-- TOC entry 9476 (class 0 OID 0)
-- Dependencies: 448
-- Name: COLUMN elemento.idelemento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN elemento.idelemento IS 'Identificacion del tipo de elemento';


--
-- TOC entry 9477 (class 0 OID 0)
-- Dependencies: 448
-- Name: COLUMN elemento.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN elemento.descripcion IS 'Caracteristicas especificas del elemento';


--
-- TOC entry 9478 (class 0 OID 0)
-- Dependencies: 448
-- Name: COLUMN elemento.idtipobien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN elemento.idtipobien IS 'Identificacion tipo de bien';


--
-- TOC entry 449 (class 1259 OID 87534)
-- Dependencies: 448 11
-- Name: elemento_idelemento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE elemento_idelemento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.elemento_idelemento_seq OWNER TO postgres;

--
-- TOC entry 9479 (class 0 OID 0)
-- Dependencies: 449
-- Name: elemento_idelemento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE elemento_idelemento_seq OWNED BY elemento.idelemento;


--
-- TOC entry 953 (class 1259 OID 125840)
-- Dependencies: 11
-- Name: equipocampo_idequipodiligenciaexhumacion_seq; Type: SEQUENCE; Schema: public; Owner: sijyp
--

CREATE SEQUENCE equipocampo_idequipodiligenciaexhumacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483648
    CACHE 1;


ALTER TABLE public.equipocampo_idequipodiligenciaexhumacion_seq OWNER TO sijyp;

--
-- TOC entry 951 (class 1259 OID 125831)
-- Dependencies: 11
-- Name: equipocriminalistica_idequipodiligenciaexhumacion_seq; Type: SEQUENCE; Schema: public; Owner: sijyp
--

CREATE SEQUENCE equipocriminalistica_idequipodiligenciaexhumacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483648
    CACHE 1;


ALTER TABLE public.equipocriminalistica_idequipodiligenciaexhumacion_seq OWNER TO sijyp;

--
-- TOC entry 450 (class 1259 OID 87536)
-- Dependencies: 11
-- Name: estadocivil_idestadocivil_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadocivil_idestadocivil_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.estadocivil_idestadocivil_seq OWNER TO postgres;

--
-- TOC entry 451 (class 1259 OID 87538)
-- Dependencies: 7299 11
-- Name: estadocivil; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadocivil (
    idestadocivil integer DEFAULT nextval('estadocivil_idestadocivil_seq'::regclass) NOT NULL,
    estadocivil character varying(30) NOT NULL
);


ALTER TABLE public.estadocivil OWNER TO postgres;

--
-- TOC entry 9480 (class 0 OID 0)
-- Dependencies: 451
-- Name: TABLE estadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estadocivil IS 'Tabla estado civil';


--
-- TOC entry 9481 (class 0 OID 0)
-- Dependencies: 451
-- Name: COLUMN estadocivil.idestadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadocivil.idestadocivil IS 'Numero unici del estado civil';


--
-- TOC entry 9482 (class 0 OID 0)
-- Dependencies: 451
-- Name: COLUMN estadocivil.estadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadocivil.estadocivil IS 'Estado civil';


--
-- TOC entry 452 (class 1259 OID 87542)
-- Dependencies: 11
-- Name: estadoetapaproceso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadoetapaproceso (
    idestadoetapaproceso integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.estadoetapaproceso OWNER TO postgres;

--
-- TOC entry 9483 (class 0 OID 0)
-- Dependencies: 452
-- Name: TABLE estadoetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estadoetapaproceso IS 'Estados en los que se puede encontrar un proceso de Justicia y Paz.';


--
-- TOC entry 9484 (class 0 OID 0)
-- Dependencies: 452
-- Name: COLUMN estadoetapaproceso.idestadoetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso.idestadoetapaproceso IS 'Identificador unico del estado etapa proceso.';


--
-- TOC entry 9485 (class 0 OID 0)
-- Dependencies: 452
-- Name: COLUMN estadoetapaproceso.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso.descripcion IS 'Descripcion del estado etapa proceso.';


--
-- TOC entry 9486 (class 0 OID 0)
-- Dependencies: 452
-- Name: COLUMN estadoetapaproceso.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 453 (class 1259 OID 87545)
-- Dependencies: 11
-- Name: estadoetapaproceso_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadoetapaproceso_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idestadoetapaproceso integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.estadoetapaproceso_audit OWNER TO postgres;

--
-- TOC entry 9487 (class 0 OID 0)
-- Dependencies: 453
-- Name: TABLE estadoetapaproceso_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estadoetapaproceso_audit IS 'Actualizacion o modificacion de los estados en los que se puede encontrar un proceso de Justicia y Paz.
';


--
-- TOC entry 9488 (class 0 OID 0)
-- Dependencies: 453
-- Name: COLUMN estadoetapaproceso_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9489 (class 0 OID 0)
-- Dependencies: 453
-- Name: COLUMN estadoetapaproceso_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9490 (class 0 OID 0)
-- Dependencies: 453
-- Name: COLUMN estadoetapaproceso_audit.idestadoetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso_audit.idestadoetapaproceso IS 'Identificador unico del estado etapa proceso.';


--
-- TOC entry 9491 (class 0 OID 0)
-- Dependencies: 453
-- Name: COLUMN estadoetapaproceso_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso_audit.descripcion IS 'Descripcion del estado etapa proceso.';


--
-- TOC entry 9492 (class 0 OID 0)
-- Dependencies: 453
-- Name: COLUMN estadoetapaproceso_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadoetapaproceso_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 454 (class 1259 OID 87548)
-- Dependencies: 452 11
-- Name: estadoetapaproceso_idestadoetapaproceso_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadoetapaproceso_idestadoetapaproceso_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estadoetapaproceso_idestadoetapaproceso_seq OWNER TO postgres;

--
-- TOC entry 9493 (class 0 OID 0)
-- Dependencies: 454
-- Name: estadoetapaproceso_idestadoetapaproceso_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadoetapaproceso_idestadoetapaproceso_seq OWNED BY estadoetapaproceso.idestadoetapaproceso;


--
-- TOC entry 455 (class 1259 OID 87550)
-- Dependencies: 11
-- Name: estadohistoricoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadohistoricoprocesal (
    idestadohistoricoprocesal integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.estadohistoricoprocesal OWNER TO postgres;

--
-- TOC entry 9494 (class 0 OID 0)
-- Dependencies: 455
-- Name: COLUMN estadohistoricoprocesal.idestadohistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohistoricoprocesal.idestadohistoricoprocesal IS 'Identificador unico del estado del historico procesal.';


--
-- TOC entry 9495 (class 0 OID 0)
-- Dependencies: 455
-- Name: COLUMN estadohistoricoprocesal.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohistoricoprocesal.descripcion IS 'Descripcion de la estado del historico procesal.';


--
-- TOC entry 9496 (class 0 OID 0)
-- Dependencies: 455
-- Name: COLUMN estadohistoricoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohistoricoprocesal.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 456 (class 1259 OID 87553)
-- Dependencies: 11
-- Name: estadohistoricoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadohistoricoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idestadohistoricoprocesal integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.estadohistoricoprocesal_audit OWNER TO postgres;

--
-- TOC entry 457 (class 1259 OID 87556)
-- Dependencies: 455 11
-- Name: estadohistoricoprocesal_idestadohistoricoprocesal_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadohistoricoprocesal_idestadohistoricoprocesal_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estadohistoricoprocesal_idestadohistoricoprocesal_seq OWNER TO postgres;

--
-- TOC entry 9497 (class 0 OID 0)
-- Dependencies: 457
-- Name: estadohistoricoprocesal_idestadohistoricoprocesal_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadohistoricoprocesal_idestadohistoricoprocesal_seq OWNED BY estadohistoricoprocesal.idestadohistoricoprocesal;


--
-- TOC entry 458 (class 1259 OID 87558)
-- Dependencies: 11
-- Name: estadopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadopostulado (
    idestadopostulado integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.estadopostulado OWNER TO postgres;

--
-- TOC entry 9498 (class 0 OID 0)
-- Dependencies: 458
-- Name: COLUMN estadopostulado.idestadopostulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadopostulado.idestadopostulado IS 'Identifcador unico para el estado del postulado.';


--
-- TOC entry 9499 (class 0 OID 0)
-- Dependencies: 458
-- Name: COLUMN estadopostulado.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadopostulado.descripcion IS 'Descripcion del estado de un postulado.';


--
-- TOC entry 459 (class 1259 OID 87561)
-- Dependencies: 11
-- Name: estadopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idestadopostulado integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.estadopostulado_audit OWNER TO postgres;

--
-- TOC entry 460 (class 1259 OID 87564)
-- Dependencies: 458 11
-- Name: estadopostulado_idestadopostulado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadopostulado_idestadopostulado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estadopostulado_idestadopostulado_seq OWNER TO postgres;

--
-- TOC entry 9500 (class 0 OID 0)
-- Dependencies: 460
-- Name: estadopostulado_idestadopostulado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadopostulado_idestadopostulado_seq OWNED BY estadopostulado.idestadopostulado;


--
-- TOC entry 461 (class 1259 OID 87566)
-- Dependencies: 11
-- Name: estadoprogramacionreporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadoprogramacionreporte (
    idestadoprogramacionreporte integer NOT NULL,
    estadoprgramacion character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.estadoprogramacionreporte OWNER TO postgres;

--
-- TOC entry 462 (class 1259 OID 87569)
-- Dependencies: 11
-- Name: estadoprogramacionreporte_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estadoprogramacionreporte_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idestadoprogramacionreporte integer,
    estadoprgramacion character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.estadoprogramacionreporte_audit OWNER TO postgres;

--
-- TOC entry 463 (class 1259 OID 87572)
-- Dependencies: 461 11
-- Name: estadoprogramacionreporte_idestadoprogramacionreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadoprogramacionreporte_idestadoprogramacionreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estadoprogramacionreporte_idestadoprogramacionreporte_seq OWNER TO postgres;

--
-- TOC entry 9501 (class 0 OID 0)
-- Dependencies: 463
-- Name: estadoprogramacionreporte_idestadoprogramacionreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadoprogramacionreporte_idestadoprogramacionreporte_seq OWNED BY estadoprogramacionreporte.idestadoprogramacionreporte;


--
-- TOC entry 464 (class 1259 OID 87574)
-- Dependencies: 11
-- Name: estructura_idestructura_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estructura_idestructura_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.estructura_idestructura_seq OWNER TO postgres;

--
-- TOC entry 465 (class 1259 OID 87576)
-- Dependencies: 7304 11
-- Name: estructura; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estructura (
    idestructura integer DEFAULT nextval('estructura_idestructura_seq'::regclass) NOT NULL,
    nombreestructura character varying(100) NOT NULL,
    idgrupoarmado integer NOT NULL
);


ALTER TABLE public.estructura OWNER TO postgres;

--
-- TOC entry 9502 (class 0 OID 0)
-- Dependencies: 465
-- Name: TABLE estructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estructura IS 'Estructura del grupo armado';


--
-- TOC entry 9503 (class 0 OID 0)
-- Dependencies: 465
-- Name: COLUMN estructura.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estructura.idestructura IS 'Numero identificacion de la estructura';


--
-- TOC entry 9504 (class 0 OID 0)
-- Dependencies: 465
-- Name: COLUMN estructura.nombreestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estructura.nombreestructura IS 'Nombre estructura';


--
-- TOC entry 9505 (class 0 OID 0)
-- Dependencies: 465
-- Name: COLUMN estructura.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estructura.idgrupoarmado IS 'Identificacion grupo armado';


--
-- TOC entry 466 (class 1259 OID 87580)
-- Dependencies: 11
-- Name: etapaflujoinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapaflujoinformacion (
    idetapaflujoinformacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.etapaflujoinformacion OWNER TO postgres;

--
-- TOC entry 9506 (class 0 OID 0)
-- Dependencies: 466
-- Name: TABLE etapaflujoinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE etapaflujoinformacion IS 'Etapas del flujo de informacion de una fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 9507 (class 0 OID 0)
-- Dependencies: 466
-- Name: COLUMN etapaflujoinformacion.idetapaflujoinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion.idetapaflujoinformacion IS 'Identifcador unico de las etapas del flujo de informacion de una fuente de informacion';


--
-- TOC entry 9508 (class 0 OID 0)
-- Dependencies: 466
-- Name: COLUMN etapaflujoinformacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion.descripcion IS 'Descripcion de las etapas del flujo de informacion de una fuente de informacion';


--
-- TOC entry 9509 (class 0 OID 0)
-- Dependencies: 466
-- Name: COLUMN etapaflujoinformacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 467 (class 1259 OID 87583)
-- Dependencies: 11
-- Name: etapaflujoinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapaflujoinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idetapaflujoinformacion integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.etapaflujoinformacion_audit OWNER TO postgres;

--
-- TOC entry 9510 (class 0 OID 0)
-- Dependencies: 467
-- Name: TABLE etapaflujoinformacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE etapaflujoinformacion_audit IS 'Etapas del flujo de informacion de una fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 9511 (class 0 OID 0)
-- Dependencies: 467
-- Name: COLUMN etapaflujoinformacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9512 (class 0 OID 0)
-- Dependencies: 467
-- Name: COLUMN etapaflujoinformacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9513 (class 0 OID 0)
-- Dependencies: 467
-- Name: COLUMN etapaflujoinformacion_audit.idetapaflujoinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion_audit.idetapaflujoinformacion IS 'Identifcador unico de las etapas del flujo de informacion de una fuente de informacion de descripcion de las etapas del flujo de informacion de una fuente de informacion';


--
-- TOC entry 9514 (class 0 OID 0)
-- Dependencies: 467
-- Name: COLUMN etapaflujoinformacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaflujoinformacion_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 468 (class 1259 OID 87586)
-- Dependencies: 466 11
-- Name: etapaflujoinformacion_idetapaflujoinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE etapaflujoinformacion_idetapaflujoinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.etapaflujoinformacion_idetapaflujoinformacion_seq OWNER TO postgres;

--
-- TOC entry 9515 (class 0 OID 0)
-- Dependencies: 468
-- Name: etapaflujoinformacion_idetapaflujoinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE etapaflujoinformacion_idetapaflujoinformacion_seq OWNED BY etapaflujoinformacion.idetapaflujoinformacion;


--
-- TOC entry 469 (class 1259 OID 87588)
-- Dependencies: 7307 11
-- Name: etapahistoricoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapahistoricoprocesal (
    idetapahistoricoprocesal integer NOT NULL,
    descripcion character varying(100),
    idtipoley integer DEFAULT 0 NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.etapahistoricoprocesal OWNER TO postgres;

--
-- TOC entry 9516 (class 0 OID 0)
-- Dependencies: 469
-- Name: COLUMN etapahistoricoprocesal.idetapahistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapahistoricoprocesal.idetapahistoricoprocesal IS 'Identificador unico de la etapa historico procesal.';


--
-- TOC entry 9517 (class 0 OID 0)
-- Dependencies: 469
-- Name: COLUMN etapahistoricoprocesal.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapahistoricoprocesal.descripcion IS 'Descripcion de la etapa de la etapa historico procesal.';


--
-- TOC entry 9518 (class 0 OID 0)
-- Dependencies: 469
-- Name: COLUMN etapahistoricoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapahistoricoprocesal.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 470 (class 1259 OID 87592)
-- Dependencies: 11
-- Name: etapahistoricoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapahistoricoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idetapahistoricoprocesal integer,
    descripcion character varying(100),
    idtipoley integer,
    usuario character varying(10)
);


ALTER TABLE public.etapahistoricoprocesal_audit OWNER TO postgres;

--
-- TOC entry 471 (class 1259 OID 87595)
-- Dependencies: 469 11
-- Name: etapahistoricoprocesal_idetapahistoricoprocesal_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE etapahistoricoprocesal_idetapahistoricoprocesal_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.etapahistoricoprocesal_idetapahistoricoprocesal_seq OWNER TO postgres;

--
-- TOC entry 9519 (class 0 OID 0)
-- Dependencies: 471
-- Name: etapahistoricoprocesal_idetapahistoricoprocesal_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE etapahistoricoprocesal_idetapahistoricoprocesal_seq OWNED BY etapahistoricoprocesal.idetapahistoricoprocesal;


--
-- TOC entry 472 (class 1259 OID 87597)
-- Dependencies: 11
-- Name: etapaproceso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapaproceso (
    idetapaproceso integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.etapaproceso OWNER TO postgres;

--
-- TOC entry 9520 (class 0 OID 0)
-- Dependencies: 472
-- Name: TABLE etapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE etapaproceso IS 'Etapas del proceso de Justicia y Paz';


--
-- TOC entry 9521 (class 0 OID 0)
-- Dependencies: 472
-- Name: COLUMN etapaproceso.idetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso.idetapaproceso IS 'Identifcador unico de la etapa del proceso.';


--
-- TOC entry 9522 (class 0 OID 0)
-- Dependencies: 472
-- Name: COLUMN etapaproceso.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso.descripcion IS 'Descripcion de la etapa del proceso.';


--
-- TOC entry 9523 (class 0 OID 0)
-- Dependencies: 472
-- Name: COLUMN etapaproceso.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 473 (class 1259 OID 87600)
-- Dependencies: 11
-- Name: etapaproceso_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE etapaproceso_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idetapaproceso integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.etapaproceso_audit OWNER TO postgres;

--
-- TOC entry 9524 (class 0 OID 0)
-- Dependencies: 473
-- Name: TABLE etapaproceso_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE etapaproceso_audit IS 'Etapas del proceso de Justicia y Paz';


--
-- TOC entry 9525 (class 0 OID 0)
-- Dependencies: 473
-- Name: COLUMN etapaproceso_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9526 (class 0 OID 0)
-- Dependencies: 473
-- Name: COLUMN etapaproceso_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9527 (class 0 OID 0)
-- Dependencies: 473
-- Name: COLUMN etapaproceso_audit.idetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso_audit.idetapaproceso IS 'Identifcador unico de la etapa del proceso.';


--
-- TOC entry 9528 (class 0 OID 0)
-- Dependencies: 473
-- Name: COLUMN etapaproceso_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso_audit.descripcion IS 'Descripcion de la etapa del proceso.';


--
-- TOC entry 9529 (class 0 OID 0)
-- Dependencies: 473
-- Name: COLUMN etapaproceso_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN etapaproceso_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 474 (class 1259 OID 87603)
-- Dependencies: 472 11
-- Name: etapaproceso_idetapaproceso_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE etapaproceso_idetapaproceso_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.etapaproceso_idetapaproceso_seq OWNER TO postgres;

--
-- TOC entry 9530 (class 0 OID 0)
-- Dependencies: 474
-- Name: etapaproceso_idetapaproceso_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE etapaproceso_idetapaproceso_seq OWNED BY etapaproceso.idetapaproceso;


--
-- TOC entry 475 (class 1259 OID 87605)
-- Dependencies: 7309 7310 7311 7312 7313 7314 7315 11
-- Name: evento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE evento (
    idevento integer NOT NULL,
    idautoridadradicado integer,
    fechainicial date,
    delitoprincipal integer NOT NULL,
    radicado character varying NOT NULL,
    descripcionevento text NOT NULL,
    pais integer NOT NULL,
    departamento integer NOT NULL,
    municipio integer,
    corregimiento character varying(100),
    vereda character varying(100),
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    fechafinal date,
    horainicial character varying(10),
    horafinal character varying(10),
    idfuenteinformacion integer NOT NULL,
    ideventorelacionado integer,
    compania character varying(100),
    escuadra character varying(100),
    inspeccion character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    sitio character varying(200),
    finca character varying(100),
    usuario character varying(10),
    titulo character varying(200) DEFAULT ''::character varying NOT NULL,
    idconnotacion integer DEFAULT 0 NOT NULL,
    tienerelacionbienes smallint DEFAULT 0 NOT NULL,
    idtipofecha integer DEFAULT 1 NOT NULL,
    descripciontipofecha character varying(200),
    idorigenevento integer DEFAULT 0 NOT NULL,
    aplicaley smallint DEFAULT 1,
    descripcionaplicaley text DEFAULT ''::text,
    fecharegistrosistema date,
    idaplicaley integer,
    narracionparcial boolean
);


ALTER TABLE public.evento OWNER TO postgres;

--
-- TOC entry 9531 (class 0 OID 0)
-- Dependencies: 475
-- Name: TABLE evento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE evento IS 'Tabla que relaciona todas las caracteristicas del evento';


--
-- TOC entry 9532 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idevento IS 'Identificacion del evento';


--
-- TOC entry 9533 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idautoridadradicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idautoridadradicado IS 'Numero de identificacion de la autoridad donde se radico ';


--
-- TOC entry 9534 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.fechainicial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.fechainicial IS 'Fecha inicial del evento';


--
-- TOC entry 9535 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.delitoprincipal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.delitoprincipal IS 'Nombre Delito principal cometido';


--
-- TOC entry 9536 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.radicado IS 'Numero de radicado asignado';


--
-- TOC entry 9537 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.descripcionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.descripcionevento IS 'Relato detallado del evento';


--
-- TOC entry 9538 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.pais IS 'Pais de ocurrencia';


--
-- TOC entry 9539 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.departamento IS 'Departamento de ocurrencia';


--
-- TOC entry 9540 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.municipio IS 'Municipio de ocurrencia';


--
-- TOC entry 9541 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.corregimiento IS 'Corregimiento de ocurrencia ';


--
-- TOC entry 9542 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.vereda IS 'Nombre vereda ocurrencia';


--
-- TOC entry 9543 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idgrupoarmado IS 'Identificacion grupo armado';


--
-- TOC entry 9544 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idestructura IS 'Numero identificacion de la estructura';


--
-- TOC entry 9545 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idbloque IS 'Numero unico de bloque';


--
-- TOC entry 9546 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idfrente IS 'Numero unico de frente';


--
-- TOC entry 9547 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.fechafinal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.fechafinal IS 'Fecha final del evento';


--
-- TOC entry 9548 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.horainicial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.horainicial IS 'Hora de inicio del evento';


--
-- TOC entry 9549 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.horafinal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.horafinal IS 'Hora final del evento';


--
-- TOC entry 9550 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idfuenteinformacion IS 'Numero unico de la fuente de informacion';


--
-- TOC entry 9551 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.ideventorelacionado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.ideventorelacionado IS 'Identificacion del evento relacionado';


--
-- TOC entry 9552 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.compania; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.compania IS 'Nombre de la compania';


--
-- TOC entry 9553 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.escuadra; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.escuadra IS 'Nombre de la escuadra';


--
-- TOC entry 9554 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.inspeccion IS 'Nombre de la inspeccion';


--
-- TOC entry 9555 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.barrio IS 'Nombre del barrio';


--
-- TOC entry 9556 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.direccion IS 'Direccion';


--
-- TOC entry 9557 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.sitio IS 'Lugar del evento';


--
-- TOC entry 9558 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.finca IS 'Nombre de la finca';


--
-- TOC entry 9559 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.usuario IS 'Usuario que realiza la actualizacioin';


--
-- TOC entry 9560 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.titulo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.titulo IS 'Titulo con el cual es reconocido el evento.';


--
-- TOC entry 9561 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idconnotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idconnotacion IS 'Tipo de connotacion del evento.';


--
-- TOC entry 9562 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.tienerelacionbienes; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.tienerelacionbienes IS 'Informa si el evento tiene bienes relacionados.
0=NO
1=SI';


--
-- TOC entry 9563 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idtipofecha IS 'Tipo de Fecha del evento.';


--
-- TOC entry 9564 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.descripciontipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.descripciontipofecha IS 'Descripcion de la fecha.';


--
-- TOC entry 9565 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idorigenevento IS 'Tipo de Origen del evento.';


--
-- TOC entry 9566 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.aplicaley; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.aplicaley IS 'identifica si aplica o no la ley(1:si,0:no)';


--
-- TOC entry 9567 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.descripcionaplicaley; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.descripcionaplicaley IS 'descripcion de por que en caso de que la ley aplique';


--
-- TOC entry 9568 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN evento.idaplicaley; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento.idaplicaley IS 'identifica el por que el hecho no aplica a la ley 975';


--
-- TOC entry 476 (class 1259 OID 87618)
-- Dependencies: 11
-- Name: evento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE evento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento integer NOT NULL,
    idautoridadradicado integer,
    fechainicial date,
    delitoprincipal integer NOT NULL,
    radicado character varying NOT NULL,
    descripcionevento text NOT NULL,
    pais integer NOT NULL,
    departamento integer NOT NULL,
    municipio integer,
    corregimiento character varying(100),
    vereda character varying(100),
    idgrupoarmado bigint NOT NULL,
    idestructura bigint NOT NULL,
    idbloque bigint NOT NULL,
    idfrente bigint NOT NULL,
    fechafinal date,
    horainicial character varying(10),
    horafinal character varying(10),
    idfuenteinformacion bigint NOT NULL,
    ideventorelacionado bigint,
    compania character varying(100),
    escuadra character varying(100),
    inspeccion character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    sitio character varying(200),
    finca character varying(100),
    usuario character varying(10),
    titulo character varying(200),
    idconnotacion bigint,
    tienerelacionbienes smallint,
    idtipofecha bigint,
    descripciontipofecha character varying(200),
    idorigenevento bigint,
    aplicaley smallint,
    descripcionaplicaley text,
    fecharegistrosistema date,
    idaplicaley integer,
    narracionparcial boolean
);


ALTER TABLE public.evento_audit OWNER TO postgres;

--
-- TOC entry 9569 (class 0 OID 0)
-- Dependencies: 476
-- Name: TABLE evento_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE evento_audit IS 'Tabla caracteristicas evento
';


--
-- TOC entry 9570 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo Descripcion del Postgres SQL';


--
-- TOC entry 9571 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9572 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idevento IS 'Identificacion del evento';


--
-- TOC entry 9573 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idautoridadradicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idautoridadradicado IS 'Numero de identificacion de la autoridad donde se radico';


--
-- TOC entry 9574 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.fechainicial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.fechainicial IS 'Fecha inicial del evento';


--
-- TOC entry 9575 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.delitoprincipal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.delitoprincipal IS 'Nombre Delito principal cometido';


--
-- TOC entry 9576 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.radicado IS 'Numero de radicado asignado';


--
-- TOC entry 9577 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.descripcionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.descripcionevento IS 'Relato detallado del evento';


--
-- TOC entry 9578 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.pais IS 'Pais de ocurrencia';


--
-- TOC entry 9579 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.departamento IS 'Departamento de ocurrencia';


--
-- TOC entry 9580 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.municipio IS 'Municipio de ocurrencia';


--
-- TOC entry 9581 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.corregimiento IS 'Corregimiento de ocurrencia';


--
-- TOC entry 9582 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.vereda IS 'Nombre vereda ocurrencia';


--
-- TOC entry 9583 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idgrupoarmado IS 'Identificacion grupo armado';


--
-- TOC entry 9584 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idestructura IS 'Numero identificacion de la estructura';


--
-- TOC entry 9585 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idbloque IS 'Numero unico de bloque';


--
-- TOC entry 9586 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idfrente IS 'Numero unico de frente';


--
-- TOC entry 9587 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.fechafinal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.fechafinal IS 'Fecha final del evento';


--
-- TOC entry 9588 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.horainicial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.horainicial IS 'Hora de inicio del evento';


--
-- TOC entry 9589 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.horafinal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.horafinal IS 'Hora final del evento';


--
-- TOC entry 9590 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idfuenteinformacion IS 'Numero unico de la fuente de informacion';


--
-- TOC entry 9591 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.ideventorelacionado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.ideventorelacionado IS 'Identificacion del evento relacionado';


--
-- TOC entry 9592 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.compania; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.compania IS 'Nombre de la compania';


--
-- TOC entry 9593 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.escuadra; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.escuadra IS 'Nombre de la escuadra';


--
-- TOC entry 9594 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.inspeccion IS 'Nombre de la inspeccion';


--
-- TOC entry 9595 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.barrio IS 'Nombre del barrio';


--
-- TOC entry 9596 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.direccion IS 'Direccion';


--
-- TOC entry 9597 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.sitio IS 'Nombre del sitio';


--
-- TOC entry 9598 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.finca IS 'Nombre de la finca';


--
-- TOC entry 9599 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9600 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.titulo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.titulo IS 'Titulo con el cual es reconocido el evento.';


--
-- TOC entry 9601 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idconnotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idconnotacion IS 'Tipo de connotacion del evento.';


--
-- TOC entry 9602 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.tienerelacionbienes; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.tienerelacionbienes IS 'Informa si el evento tiene bienes relacionados.
0=NO
1=SI';


--
-- TOC entry 9603 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idtipofecha IS 'Tipo de Fecha del evento.';


--
-- TOC entry 9604 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.descripciontipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.descripciontipofecha IS 'Descripcion de la fecha.';


--
-- TOC entry 9605 (class 0 OID 0)
-- Dependencies: 476
-- Name: COLUMN evento_audit.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN evento_audit.idorigenevento IS 'Tipo de Origen del evento.';


--
-- TOC entry 477 (class 1259 OID 87624)
-- Dependencies: 475 11
-- Name: evento_idevento_seq1; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE evento_idevento_seq1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.evento_idevento_seq1 OWNER TO postgres;

--
-- TOC entry 9606 (class 0 OID 0)
-- Dependencies: 477
-- Name: evento_idevento_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE evento_idevento_seq1 OWNED BY evento.idevento;


--
-- TOC entry 478 (class 1259 OID 87626)
-- Dependencies: 11
-- Name: factoringresoga; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE factoringresoga (
    idfactoringresoga integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.factoringresoga OWNER TO postgres;

--
-- TOC entry 9607 (class 0 OID 0)
-- Dependencies: 478
-- Name: TABLE factoringresoga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE factoringresoga IS 'Listado de opciones de factores de ingreso a un grupo armado.';


--
-- TOC entry 9608 (class 0 OID 0)
-- Dependencies: 478
-- Name: COLUMN factoringresoga.idfactoringresoga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN factoringresoga.idfactoringresoga IS 'Identificador unico del factor de ingreso al grupo armado.';


--
-- TOC entry 9609 (class 0 OID 0)
-- Dependencies: 478
-- Name: COLUMN factoringresoga.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN factoringresoga.descripcion IS 'Descripcion del factor de ingreso al grupo armado.';


--
-- TOC entry 9610 (class 0 OID 0)
-- Dependencies: 478
-- Name: COLUMN factoringresoga.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN factoringresoga.usuario IS 'Usuario que realiza la insercion o actualizacion de las opciones de la lista.';


--
-- TOC entry 479 (class 1259 OID 87629)
-- Dependencies: 11
-- Name: factoringresoga_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE factoringresoga_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfactoringresoga integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.factoringresoga_audit OWNER TO postgres;

--
-- TOC entry 9611 (class 0 OID 0)
-- Dependencies: 479
-- Name: TABLE factoringresoga_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE factoringresoga_audit IS 'Control del listado de opciones de factores de ingreso a un grupo armado.';


--
-- TOC entry 9612 (class 0 OID 0)
-- Dependencies: 479
-- Name: COLUMN factoringresoga_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN factoringresoga_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 9613 (class 0 OID 0)
-- Dependencies: 479
-- Name: COLUMN factoringresoga_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN factoringresoga_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 480 (class 1259 OID 87632)
-- Dependencies: 479 11
-- Name: factoringresoga_audit_idfactoringresoga_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE factoringresoga_audit_idfactoringresoga_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.factoringresoga_audit_idfactoringresoga_seq OWNER TO postgres;

--
-- TOC entry 9614 (class 0 OID 0)
-- Dependencies: 480
-- Name: factoringresoga_audit_idfactoringresoga_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE factoringresoga_audit_idfactoringresoga_seq OWNED BY factoringresoga_audit.idfactoringresoga;


--
-- TOC entry 481 (class 1259 OID 87634)
-- Dependencies: 478 11
-- Name: factoringresoga_idfactoringresoga_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE factoringresoga_idfactoringresoga_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.factoringresoga_idfactoringresoga_seq OWNER TO postgres;

--
-- TOC entry 9615 (class 0 OID 0)
-- Dependencies: 481
-- Name: factoringresoga_idfactoringresoga_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE factoringresoga_idfactoringresoga_seq OWNED BY factoringresoga.idfactoringresoga;


--
-- TOC entry 482 (class 1259 OID 87636)
-- Dependencies: 11
-- Name: formatoreporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE formatoreporte (
    idformatoreporte integer NOT NULL,
    formatoreporte character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.formatoreporte OWNER TO postgres;

--
-- TOC entry 483 (class 1259 OID 87639)
-- Dependencies: 482 11
-- Name: formatoreporte_idformatoreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE formatoreporte_idformatoreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.formatoreporte_idformatoreporte_seq OWNER TO postgres;

--
-- TOC entry 9616 (class 0 OID 0)
-- Dependencies: 483
-- Name: formatoreporte_idformatoreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE formatoreporte_idformatoreporte_seq OWNED BY formatoreporte.idformatoreporte;


--
-- TOC entry 484 (class 1259 OID 87641)
-- Dependencies: 11
-- Name: fotos_idfoto_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fotos_idfoto_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.fotos_idfoto_seq OWNER TO postgres;

--
-- TOC entry 485 (class 1259 OID 87643)
-- Dependencies: 7320 11
-- Name: fotos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fotos (
    idfoto integer DEFAULT nextval('fotos_idfoto_seq'::regclass) NOT NULL,
    nombrearchivo character varying(100) NOT NULL,
    idpersona numeric(10,0) NOT NULL,
    usuario character varying(10),
    tipoperfilfotopersona integer,
    descripcion character varying(250),
    archivo bytea
);


ALTER TABLE public.fotos OWNER TO postgres;

--
-- TOC entry 9617 (class 0 OID 0)
-- Dependencies: 485
-- Name: TABLE fotos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fotos IS 'Tabla de fotos
';


--
-- TOC entry 9618 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.idfoto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.idfoto IS 'Numero de identificacion de la foto';


--
-- TOC entry 9619 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.nombrearchivo IS 'Nombre del archivo donde se encuentra la foto';


--
-- TOC entry 9620 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9621 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9622 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.descripcion IS 'Descripcion de la fotografia';


--
-- TOC entry 9623 (class 0 OID 0)
-- Dependencies: 485
-- Name: COLUMN fotos.archivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos.archivo IS 'Archivo de la fotografia.';


--
-- TOC entry 486 (class 1259 OID 87650)
-- Dependencies: 11
-- Name: fotos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fotos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfoto integer NOT NULL,
    nombrearchivo character varying(100) NOT NULL,
    idpersona numeric(10,0) NOT NULL,
    usuario character varying(10),
    tipoperfilfotopersona integer,
    descripcion character varying(250),
    archivo bytea
);


ALTER TABLE public.fotos_audit OWNER TO postgres;

--
-- TOC entry 9624 (class 0 OID 0)
-- Dependencies: 486
-- Name: TABLE fotos_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fotos_audit IS 'Tabla de fotos';


--
-- TOC entry 9625 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9626 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9627 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.idfoto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.idfoto IS 'Numero de identificacion de la foto';


--
-- TOC entry 9628 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.nombrearchivo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.nombrearchivo IS 'Nombre del archivo donde se encuentra la foto';


--
-- TOC entry 9629 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9630 (class 0 OID 0)
-- Dependencies: 486
-- Name: COLUMN fotos_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fotos_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 487 (class 1259 OID 87656)
-- Dependencies: 11
-- Name: frente_idfrente_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE frente_idfrente_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.frente_idfrente_seq OWNER TO postgres;

--
-- TOC entry 488 (class 1259 OID 87658)
-- Dependencies: 7321 11
-- Name: frente; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE frente (
    idfrente integer DEFAULT nextval('frente_idfrente_seq'::regclass) NOT NULL,
    frente character varying(100) NOT NULL,
    idbloque integer NOT NULL
);


ALTER TABLE public.frente OWNER TO postgres;

--
-- TOC entry 9631 (class 0 OID 0)
-- Dependencies: 488
-- Name: TABLE frente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE frente IS 'Frente';


--
-- TOC entry 9632 (class 0 OID 0)
-- Dependencies: 488
-- Name: COLUMN frente.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN frente.idfrente IS 'Identificacion del frente';


--
-- TOC entry 9633 (class 0 OID 0)
-- Dependencies: 488
-- Name: COLUMN frente.frente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN frente.frente IS 'Nombre del frente';


--
-- TOC entry 9634 (class 0 OID 0)
-- Dependencies: 488
-- Name: COLUMN frente.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN frente.idbloque IS 'Identificacion del bloque';


--
-- TOC entry 489 (class 1259 OID 87662)
-- Dependencies: 11
-- Name: fuenteinformacion_idfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fuenteinformacion_idfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.fuenteinformacion_idfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 490 (class 1259 OID 87664)
-- Dependencies: 7322 11
-- Name: fuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fuenteinformacion (
    idfuenteinformacion integer DEFAULT nextval('fuenteinformacion_idfuenteinformacion_seq'::regclass) NOT NULL,
    fuenteinformacion character varying(60) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.fuenteinformacion OWNER TO postgres;

--
-- TOC entry 9635 (class 0 OID 0)
-- Dependencies: 490
-- Name: TABLE fuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fuenteinformacion IS 'Tabla fuente de informacion';


--
-- TOC entry 9636 (class 0 OID 0)
-- Dependencies: 490
-- Name: COLUMN fuenteinformacion.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion.idfuenteinformacion IS 'Numero identificacion fuente';


--
-- TOC entry 9637 (class 0 OID 0)
-- Dependencies: 490
-- Name: COLUMN fuenteinformacion.fuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion.fuenteinformacion IS 'Nombre fuente de informacion';


--
-- TOC entry 9638 (class 0 OID 0)
-- Dependencies: 490
-- Name: COLUMN fuenteinformacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 491 (class 1259 OID 87668)
-- Dependencies: 11
-- Name: fuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfuenteinformacion integer NOT NULL,
    fuenteinformacion character varying(60) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.fuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 9639 (class 0 OID 0)
-- Dependencies: 491
-- Name: TABLE fuenteinformacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fuenteinformacion_audit IS 'Actualizacion o modificacion fuente informacion';


--
-- TOC entry 9640 (class 0 OID 0)
-- Dependencies: 491
-- Name: COLUMN fuenteinformacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9641 (class 0 OID 0)
-- Dependencies: 491
-- Name: COLUMN fuenteinformacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9642 (class 0 OID 0)
-- Dependencies: 491
-- Name: COLUMN fuenteinformacion_audit.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion_audit.idfuenteinformacion IS 'Numero identificacion fuente';


--
-- TOC entry 9643 (class 0 OID 0)
-- Dependencies: 491
-- Name: COLUMN fuenteinformacion_audit.fuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion_audit.fuenteinformacion IS 'Nombre fuente de informacion';


--
-- TOC entry 9644 (class 0 OID 0)
-- Dependencies: 491
-- Name: COLUMN fuenteinformacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformacion_audit.usuario IS 'Usuario que realiza la actualizacion'';
';


--
-- TOC entry 492 (class 1259 OID 87671)
-- Dependencies: 11
-- Name: fuenteinformaciondatos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fuenteinformaciondatos (
    idfuenteinformacion integer NOT NULL,
    idorigenfuenteinformacion integer,
    idactividadfuenteinformacion integer,
    fechainformacion date,
    idpaisfuente integer,
    iddepertamentofuente integer,
    idmunicipiofuente integer,
    sitiofuente character varying(100),
    idautoridad integer,
    funcionario character varying(10) NOT NULL,
    idcargo integer,
    idmunicipiolabor integer,
    usuario character varying(10),
    descripcionfuenteinfo text
);


ALTER TABLE public.fuenteinformaciondatos OWNER TO postgres;

--
-- TOC entry 9645 (class 0 OID 0)
-- Dependencies: 492
-- Name: TABLE fuenteinformaciondatos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fuenteinformaciondatos IS 'Fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 9646 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idfuenteinformacion IS 'Identifcador unico del origen de una fuente de informacion';


--
-- TOC entry 9647 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idorigenfuenteinformacion IS 'Identifcador unico del tipo de origen de la fuente de informacion';


--
-- TOC entry 9648 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idactividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idactividadfuenteinformacion IS 'Identifcador unico de actividad de la fuente de informacion';


--
-- TOC entry 9649 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.fechainformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.fechainformacion IS 'Fecha de la fuente de informacion';


--
-- TOC entry 9650 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idpaisfuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idpaisfuente IS 'Identificador unico del pais.';


--
-- TOC entry 9651 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.iddepertamentofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.iddepertamentofuente IS 'Identificador unico del departamento.';


--
-- TOC entry 9652 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idmunicipiofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idmunicipiofuente IS 'Identificador unico del municipio.';


--
-- TOC entry 9653 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.sitiofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.sitiofuente IS 'Descripcion del sitio de la fuente de informacion';


--
-- TOC entry 9654 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idautoridad IS 'Identifcador unico de la autoridad.';


--
-- TOC entry 9655 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.funcionario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.funcionario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 9656 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idcargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idcargo IS 'Identificador unico del cargo.';


--
-- TOC entry 9657 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.idmunicipiolabor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.idmunicipiolabor IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 9658 (class 0 OID 0)
-- Dependencies: 492
-- Name: COLUMN fuenteinformaciondatos.descripcionfuenteinfo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos.descripcionfuenteinfo IS 'descripcion de la fuente de informacion';


--
-- TOC entry 493 (class 1259 OID 87677)
-- Dependencies: 11
-- Name: fuenteinformaciondatos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fuenteinformaciondatos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfuenteinformacion integer NOT NULL,
    idorigenfuenteinformacion bigint,
    idactividadfuenteinformacion bigint,
    fechainformacion date,
    idpaisfuente bigint,
    iddepertamentofuente bigint,
    idmunicipiofuente bigint,
    sitiofuente character varying(100),
    idautoridad bigint,
    funcionario character varying(10) NOT NULL,
    idcargo bigint,
    idmunicipiolabor bigint,
    usuario character varying(10),
    descripcionfuenteinfo text
);


ALTER TABLE public.fuenteinformaciondatos_audit OWNER TO postgres;

--
-- TOC entry 9659 (class 0 OID 0)
-- Dependencies: 493
-- Name: TABLE fuenteinformaciondatos_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE fuenteinformaciondatos_audit IS 'fuenteinformaciondatos';


--
-- TOC entry 9660 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9661 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9662 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idfuenteinformacion IS 'Identifcador unico del origen de una fuente de informacion';


--
-- TOC entry 9663 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idorigenfuenteinformacion IS 'Identifcador unico del tipo de origen de la fuente de informacion';


--
-- TOC entry 9664 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idactividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idactividadfuenteinformacion IS 'Identifcador unico de actividad de la fuente de informacion';


--
-- TOC entry 9665 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.fechainformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.fechainformacion IS 'Fecha de la fuente de informacion';


--
-- TOC entry 9666 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idpaisfuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idpaisfuente IS 'Identificador unico del pais.';


--
-- TOC entry 9667 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.iddepertamentofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.iddepertamentofuente IS 'Identificador unico del departamento.';


--
-- TOC entry 9668 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idmunicipiofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idmunicipiofuente IS 'Identificador unico del municipio.';


--
-- TOC entry 9669 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.sitiofuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.sitiofuente IS 'Descripcion del sitio de la fuente de informacion';


--
-- TOC entry 9670 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idautoridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idautoridad IS 'Identifcador unico de la autoridad.';


--
-- TOC entry 9671 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idcargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idcargo IS 'Identificador unico del cargo.';


--
-- TOC entry 9672 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.idmunicipiolabor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.idmunicipiolabor IS 'Identificacion del municipio donde labor';


--
-- TOC entry 9673 (class 0 OID 0)
-- Dependencies: 493
-- Name: COLUMN fuenteinformaciondatos_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN fuenteinformaciondatos_audit.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 494 (class 1259 OID 87686)
-- Dependencies: 493 11
-- Name: fuenteinformaciondatos_audit_idfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fuenteinformaciondatos_audit_idfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fuenteinformaciondatos_audit_idfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 9674 (class 0 OID 0)
-- Dependencies: 494
-- Name: fuenteinformaciondatos_audit_idfuenteinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE fuenteinformaciondatos_audit_idfuenteinformacion_seq OWNED BY fuenteinformaciondatos_audit.idfuenteinformacion;


--
-- TOC entry 495 (class 1259 OID 87688)
-- Dependencies: 492 11
-- Name: fuenteinformaciondatos_idfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fuenteinformaciondatos_idfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fuenteinformaciondatos_idfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 9675 (class 0 OID 0)
-- Dependencies: 495
-- Name: fuenteinformaciondatos_idfuenteinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE fuenteinformaciondatos_idfuenteinformacion_seq OWNED BY fuenteinformaciondatos.idfuenteinformacion;


--
-- TOC entry 496 (class 1259 OID 87690)
-- Dependencies: 11
-- Name: funcion_idfuncion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE funcion_idfuncion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.funcion_idfuncion_seq OWNER TO postgres;

--
-- TOC entry 497 (class 1259 OID 87692)
-- Dependencies: 7325 11
-- Name: funcion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE funcion (
    idfuncion integer DEFAULT nextval('funcion_idfuncion_seq'::regclass) NOT NULL,
    funcion character varying(50),
    ejecucion character varying(100),
    idmenu numeric(10,0) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.funcion OWNER TO postgres;

--
-- TOC entry 9676 (class 0 OID 0)
-- Dependencies: 497
-- Name: TABLE funcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE funcion IS 'Nombre de la funcion a realizar';


--
-- TOC entry 9677 (class 0 OID 0)
-- Dependencies: 497
-- Name: COLUMN funcion.idfuncion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion.idfuncion IS 'Numero unico id. de la funcion
';


--
-- TOC entry 9678 (class 0 OID 0)
-- Dependencies: 497
-- Name: COLUMN funcion.funcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion.funcion IS 'Nombre de la funcion';


--
-- TOC entry 9679 (class 0 OID 0)
-- Dependencies: 497
-- Name: COLUMN funcion.ejecucion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion.ejecucion IS 'Forma de ejecucion';


--
-- TOC entry 9680 (class 0 OID 0)
-- Dependencies: 497
-- Name: COLUMN funcion.idmenu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion.idmenu IS 'Identificacion del menu';


--
-- TOC entry 9681 (class 0 OID 0)
-- Dependencies: 497
-- Name: COLUMN funcion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 498 (class 1259 OID 87696)
-- Dependencies: 11
-- Name: funcion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE funcion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfuncion integer NOT NULL,
    funcion character varying(50),
    ejecucion character varying(100),
    idmenu numeric(10,0) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.funcion_audit OWNER TO postgres;

--
-- TOC entry 9682 (class 0 OID 0)
-- Dependencies: 498
-- Name: TABLE funcion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE funcion_audit IS 'Funcion';


--
-- TOC entry 9683 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9684 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9685 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.idfuncion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.idfuncion IS 'Numero unico id. de la funcion';


--
-- TOC entry 9686 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.funcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.funcion IS 'Nombre de la funcion';


--
-- TOC entry 9687 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.ejecucion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.ejecucion IS 'Forma de ejecucion';


--
-- TOC entry 9688 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.idmenu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.idmenu IS 'Identificacion del menu';


--
-- TOC entry 9689 (class 0 OID 0)
-- Dependencies: 498
-- Name: COLUMN funcion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN funcion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 499 (class 1259 OID 87699)
-- Dependencies: 11
-- Name: genero; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE genero (
    idgenero character varying(1) NOT NULL,
    genero character varying(20) NOT NULL
);


ALTER TABLE public.genero OWNER TO postgres;

--
-- TOC entry 9690 (class 0 OID 0)
-- Dependencies: 499
-- Name: TABLE genero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE genero IS 'Tabla de genero';


--
-- TOC entry 9691 (class 0 OID 0)
-- Dependencies: 499
-- Name: COLUMN genero.idgenero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN genero.idgenero IS 'Identificacion del genero';


--
-- TOC entry 9692 (class 0 OID 0)
-- Dependencies: 499
-- Name: COLUMN genero.genero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN genero.genero IS 'Nombre del genero';


--
-- TOC entry 500 (class 1259 OID 87702)
-- Dependencies: 11
-- Name: genesisgrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE genesisgrupoarmado (
    idgenesisgrupoarmado integer NOT NULL,
    idtipofenomenohistorico integer NOT NULL,
    idtipofecha integer NOT NULL,
    fechainicial date,
    fechafin date,
    descripcionfecha character varying(255),
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer,
    idfrente integer,
    nivel5 character varying(100),
    nivel6 character varying(100),
    idpais integer NOT NULL,
    iddepartamento integer NOT NULL,
    idmunicipio integer NOT NULL,
    corregimineto character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(100),
    resumen text,
    motivo text,
    objetivo text,
    usuario character varying(10)
);


ALTER TABLE public.genesisgrupoarmado OWNER TO postgres;

--
-- TOC entry 501 (class 1259 OID 87708)
-- Dependencies: 11
-- Name: genesisgrupoarmado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE genesisgrupoarmado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgenesisgrupoarmado integer NOT NULL,
    idtipofenomenohistorico integer,
    idtipofecha integer,
    fechainicial date,
    fechafin date,
    descripcionfecha character varying(255),
    idgrupoarmado integer,
    idestructura integer,
    idbloque integer,
    idfrente integer,
    nivel5 character varying(100),
    nivel6 character varying(100),
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimineto character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(100),
    resumen text,
    motivo text,
    objetivo text,
    usuario character varying(10)
);


ALTER TABLE public.genesisgrupoarmado_audit OWNER TO postgres;

--
-- TOC entry 502 (class 1259 OID 87714)
-- Dependencies: 501 11
-- Name: genesisgrupoarmado_audit_idgenesisgrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE genesisgrupoarmado_audit_idgenesisgrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.genesisgrupoarmado_audit_idgenesisgrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9693 (class 0 OID 0)
-- Dependencies: 502
-- Name: genesisgrupoarmado_audit_idgenesisgrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE genesisgrupoarmado_audit_idgenesisgrupoarmado_seq OWNED BY genesisgrupoarmado_audit.idgenesisgrupoarmado;


--
-- TOC entry 503 (class 1259 OID 87716)
-- Dependencies: 500 11
-- Name: genesisgrupoarmado_idgenesisgrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE genesisgrupoarmado_idgenesisgrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.genesisgrupoarmado_idgenesisgrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9694 (class 0 OID 0)
-- Dependencies: 503
-- Name: genesisgrupoarmado_idgenesisgrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE genesisgrupoarmado_idgenesisgrupoarmado_seq OWNED BY genesisgrupoarmado.idgenesisgrupoarmado;


--
-- TOC entry 504 (class 1259 OID 87718)
-- Dependencies: 7328 11
-- Name: georeferenciacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE georeferenciacion (
    idpais bigint NOT NULL,
    iddepartamento bigint NOT NULL,
    idmunicipio bigint NOT NULL,
    idgrupoarmado bigint NOT NULL,
    idestructura bigint NOT NULL,
    idbloque bigint NOT NULL,
    idfrente bigint NOT NULL,
    fechainicio date NOT NULL,
    fechafin date NOT NULL,
    usuario character varying(10) NOT NULL,
    observaciones text DEFAULT ''::text
);


ALTER TABLE public.georeferenciacion OWNER TO postgres;

--
-- TOC entry 9695 (class 0 OID 0)
-- Dependencies: 504
-- Name: TABLE georeferenciacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE georeferenciacion IS 'Tabla de georeferenciacion';


--
-- TOC entry 9696 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idpais IS 'Identificacion del pais';


--
-- TOC entry 9697 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9698 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9699 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idgrupoarmado IS 'Numero unico Identificacion grupo armado';


--
-- TOC entry 9700 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idestructura IS 'Identificacion de la estructura';


--
-- TOC entry 9701 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idbloque IS 'Identificacion del bloque';


--
-- TOC entry 9702 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.idfrente IS 'Identificacion del frente';


--
-- TOC entry 9703 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.fechainicio IS 'Fecha inicio ';


--
-- TOC entry 9704 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.fechafin IS 'Fecha final';


--
-- TOC entry 9705 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9706 (class 0 OID 0)
-- Dependencies: 504
-- Name: COLUMN georeferenciacion.observaciones; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion.observaciones IS 'Observaciones de la Geroreferenciacion';


--
-- TOC entry 505 (class 1259 OID 87725)
-- Dependencies: 11
-- Name: georeferenciacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE georeferenciacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpais bigint NOT NULL,
    iddepartamento bigint NOT NULL,
    idmunicipio bigint NOT NULL,
    idgrupoarmado bigint NOT NULL,
    idestructura bigint NOT NULL,
    idbloque bigint NOT NULL,
    idfrente bigint NOT NULL,
    fechainicio date NOT NULL,
    fechafin date NOT NULL,
    usuario character varying(10) NOT NULL,
    observaciones text
);


ALTER TABLE public.georeferenciacion_audit OWNER TO postgres;

--
-- TOC entry 9707 (class 0 OID 0)
-- Dependencies: 505
-- Name: TABLE georeferenciacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE georeferenciacion_audit IS 'Tabla de georeferenciacion';


--
-- TOC entry 9708 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9709 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9710 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idpais IS 'Identificacion del pais';


--
-- TOC entry 9711 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9712 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9713 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idgrupoarmado IS 'Numero unico Identificacion grupo armado';


--
-- TOC entry 9714 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idestructura IS 'Identificacion de la estructura';


--
-- TOC entry 9715 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idbloque IS '''Identificacion del bloque';


--
-- TOC entry 9716 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.idfrente IS 'Identificacion del frente';


--
-- TOC entry 9717 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.fechainicio IS 'Fecha inicio';


--
-- TOC entry 9718 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.fechafin IS 'Fecha final';


--
-- TOC entry 9719 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9720 (class 0 OID 0)
-- Dependencies: 505
-- Name: COLUMN georeferenciacion_audit.observaciones; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN georeferenciacion_audit.observaciones IS 'Observaciones de georeferenciacion';


--
-- TOC entry 506 (class 1259 OID 87731)
-- Dependencies: 11
-- Name: georeferenciaciongrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE georeferenciaciongrupoarmado (
    idgeoreferenciaciongrupoarmado integer NOT NULL,
    idtipofecha integer NOT NULL,
    fechainicial date,
    fechafin date,
    descripcionfecha character varying(255),
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer,
    idfrente integer,
    nivel5 character varying(100),
    nivel6 character varying(100),
    idpais integer NOT NULL,
    iddepartamento integer NOT NULL,
    idmunicipio integer NOT NULL,
    corregimineto character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(100),
    observacion text,
    usuario character varying(10)
);


ALTER TABLE public.georeferenciaciongrupoarmado OWNER TO postgres;

--
-- TOC entry 507 (class 1259 OID 87737)
-- Dependencies: 11
-- Name: georeferenciaciongrupoarmado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE georeferenciaciongrupoarmado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgeoreferenciaciongrupoarmado integer,
    idtipofecha integer,
    fechainicial date,
    fechafin date,
    descripcionfecha character varying(255),
    idgrupoarmado integer,
    idestructura integer,
    idbloque integer,
    idfrente integer,
    nivel5 character varying(100),
    nivel6 character varying(100),
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimineto character varying(100),
    vereda character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(100),
    observacion text,
    usuario character varying(10)
);


ALTER TABLE public.georeferenciaciongrupoarmado_audit OWNER TO postgres;

--
-- TOC entry 508 (class 1259 OID 87743)
-- Dependencies: 506 11
-- Name: georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9721 (class 0 OID 0)
-- Dependencies: 508
-- Name: georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq OWNED BY georeferenciaciongrupoarmado.idgeoreferenciaciongrupoarmado;


--
-- TOC entry 509 (class 1259 OID 87745)
-- Dependencies: 11
-- Name: grupoarmado_idgrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE grupoarmado_idgrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.grupoarmado_idgrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 510 (class 1259 OID 87747)
-- Dependencies: 7330 11
-- Name: grupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE grupoarmado (
    idgrupoarmado integer DEFAULT nextval('grupoarmado_idgrupoarmado_seq'::regclass) NOT NULL,
    grupoarmado character varying(60) NOT NULL
);


ALTER TABLE public.grupoarmado OWNER TO postgres;

--
-- TOC entry 9722 (class 0 OID 0)
-- Dependencies: 510
-- Name: TABLE grupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE grupoarmado IS 'Tabla grupo armado';


--
-- TOC entry 9723 (class 0 OID 0)
-- Dependencies: 510
-- Name: COLUMN grupoarmado.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN grupoarmado.idgrupoarmado IS 'Identificacion grupo armado';


--
-- TOC entry 9724 (class 0 OID 0)
-- Dependencies: 510
-- Name: COLUMN grupoarmado.grupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN grupoarmado.grupoarmado IS 'Nombre grupo armado';


--
-- TOC entry 511 (class 1259 OID 87751)
-- Dependencies: 11
-- Name: grupos_etnicos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE grupos_etnicos (
    idgrupos_etnicos integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.grupos_etnicos OWNER TO postgres;

--
-- TOC entry 9725 (class 0 OID 0)
-- Dependencies: 511
-- Name: TABLE grupos_etnicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE grupos_etnicos IS 'Nombres de los diferentes grupos etnicos para una persona';


--
-- TOC entry 9726 (class 0 OID 0)
-- Dependencies: 511
-- Name: COLUMN grupos_etnicos.idgrupos_etnicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN grupos_etnicos.idgrupos_etnicos IS 'Identifcador unico del grupo etnico.';


--
-- TOC entry 9727 (class 0 OID 0)
-- Dependencies: 511
-- Name: COLUMN grupos_etnicos.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN grupos_etnicos.descripcion IS 'Descripcion del grupo etnico.';


--
-- TOC entry 9728 (class 0 OID 0)
-- Dependencies: 511
-- Name: COLUMN grupos_etnicos.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN grupos_etnicos.usuario IS 'Usuario que realiza registra el grupo etnico.';


--
-- TOC entry 512 (class 1259 OID 87754)
-- Dependencies: 11
-- Name: grupos_etnicos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE grupos_etnicos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgrupos_etnicos bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.grupos_etnicos_audit OWNER TO postgres;

--
-- TOC entry 513 (class 1259 OID 87757)
-- Dependencies: 511 11
-- Name: grupos_etnicos_idgrupos_etnicos_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE grupos_etnicos_idgrupos_etnicos_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.grupos_etnicos_idgrupos_etnicos_seq OWNER TO postgres;

--
-- TOC entry 9729 (class 0 OID 0)
-- Dependencies: 513
-- Name: grupos_etnicos_idgrupos_etnicos_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE grupos_etnicos_idgrupos_etnicos_seq OWNED BY grupos_etnicos.idgrupos_etnicos;


--
-- TOC entry 514 (class 1259 OID 87759)
-- Dependencies: 11
-- Name: gruposanguineo_idgruposanguineo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE gruposanguineo_idgruposanguineo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.gruposanguineo_idgruposanguineo_seq OWNER TO postgres;

--
-- TOC entry 515 (class 1259 OID 87761)
-- Dependencies: 7332 11
-- Name: gruposanguineo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE gruposanguineo (
    idgruposanguineo integer DEFAULT nextval('gruposanguineo_idgruposanguineo_seq'::regclass) NOT NULL,
    nombregruposanguineo character varying(20) NOT NULL
);


ALTER TABLE public.gruposanguineo OWNER TO postgres;

--
-- TOC entry 9730 (class 0 OID 0)
-- Dependencies: 515
-- Name: TABLE gruposanguineo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE gruposanguineo IS 'Tabla grupo sanguineo de las personas';


--
-- TOC entry 9731 (class 0 OID 0)
-- Dependencies: 515
-- Name: COLUMN gruposanguineo.idgruposanguineo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN gruposanguineo.idgruposanguineo IS 'Numero unico del grupo sanguineo';


--
-- TOC entry 9732 (class 0 OID 0)
-- Dependencies: 515
-- Name: COLUMN gruposanguineo.nombregruposanguineo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN gruposanguineo.nombregruposanguineo IS 'Nombre grupo sanguineo';


--
-- TOC entry 516 (class 1259 OID 87765)
-- Dependencies: 7334 11
-- Name: hecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE hecho (
    idhecho integer NOT NULL,
    fechahecho date,
    municipio integer NOT NULL,
    departamento integer NOT NULL,
    pais integer NOT NULL,
    corregimiento character varying(100),
    vereda character varying(100),
    direccion character varying(200),
    idevento integer NOT NULL,
    iddelito bigint NOT NULL,
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10),
    idmovil bigint,
    descripcionmovil character varying(200),
    idtipofecha bigint DEFAULT 1 NOT NULL,
    descripciontipofecha character varying(200)
);


ALTER TABLE public.hecho OWNER TO postgres;

--
-- TOC entry 9733 (class 0 OID 0)
-- Dependencies: 516
-- Name: TABLE hecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE hecho IS 'Tabla circunstancias del hecho';


--
-- TOC entry 9734 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.idhecho IS 'Numero unico identificacion del hecho';


--
-- TOC entry 9735 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.fechahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.fechahecho IS 'Fecha de ocurrencia del hecho';


--
-- TOC entry 9736 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.municipio IS 'Municipio del hecho';


--
-- TOC entry 9737 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.departamento IS 'Departamento del hecho';


--
-- TOC entry 9738 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.pais IS 'Pais del hecho';


--
-- TOC entry 9739 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.corregimiento IS 'COrregimiento del hecho';


--
-- TOC entry 9740 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.vereda IS 'vereda del hecho';


--
-- TOC entry 9741 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.direccion IS 'Direccion del hecho';


--
-- TOC entry 9742 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.idevento IS 'Identificacion del evento';


--
-- TOC entry 9743 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.iddelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.iddelito IS 'Identificacion del delito';


--
-- TOC entry 9744 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.inspeccion IS 'inspeccion del hecho';


--
-- TOC entry 9745 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.finca IS 'Finca del hecho';


--
-- TOC entry 9746 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.barrio IS '--ALTER TABLE hecho_audit ALTER finca TYPE character varying(100)';


--
-- TOC entry 9747 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.sitio IS 'Sitio del hecho';


--
-- TOC entry 9748 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9749 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.idmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.idmovil IS 'Movil por el cual se cometio el hecho.';


--
-- TOC entry 9750 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.descripcionmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.descripcionmovil IS 'Descripcion exacta del movil.';


--
-- TOC entry 9751 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.idtipofecha IS 'Tipo de Fecha del hecho';


--
-- TOC entry 9752 (class 0 OID 0)
-- Dependencies: 516
-- Name: COLUMN hecho.descripciontipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho.descripciontipofecha IS 'Descripcion de la fecha.';


--
-- TOC entry 517 (class 1259 OID 87769)
-- Dependencies: 11
-- Name: hecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE hecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhecho integer NOT NULL,
    fechahecho date,
    municipio integer NOT NULL,
    departamento integer NOT NULL,
    pais integer NOT NULL,
    corregimiento character varying(100),
    vereda character varying(100),
    direccion character varying(200),
    idevento integer NOT NULL,
    iddelito bigint NOT NULL,
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10),
    idmovil bigint,
    descripcionmovil character varying(200),
    idtipofecha bigint,
    descripciontipofecha character varying(200)
);


ALTER TABLE public.hecho_audit OWNER TO postgres;

--
-- TOC entry 9753 (class 0 OID 0)
-- Dependencies: 517
-- Name: TABLE hecho_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE hecho_audit IS 'Tabla circunstancias del hecho';


--
-- TOC entry 9754 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9755 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9756 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.idhecho IS 'Numero unico identificacion del hecho';


--
-- TOC entry 9757 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.fechahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.fechahecho IS 'Fecha de ocurrencia del hecho';


--
-- TOC entry 9758 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.municipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.municipio IS 'Minicipio del hecho';


--
-- TOC entry 9759 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.departamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.departamento IS 'Departamento del hecho';


--
-- TOC entry 9760 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.pais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.pais IS 'pais IS ''Pais del hecho';


--
-- TOC entry 9761 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.corregimiento IS 'COrregimiento del hecho';


--
-- TOC entry 9762 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.vereda IS 'vereda del hecho';


--
-- TOC entry 9763 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.direccion IS 'Direccion del hecho';


--
-- TOC entry 9764 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.idevento IS 'Identificacion del evento';


--
-- TOC entry 9765 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.iddelito; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.iddelito IS 'Identificacion del delito';


--
-- TOC entry 9766 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.inspeccion IS 'inspeccion del hecho';


--
-- TOC entry 9767 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.finca IS 'Finca del hecho';


--
-- TOC entry 9768 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.sitio IS 'Sitio del hecho';


--
-- TOC entry 9769 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.usuario IS 'Usuario que realiza la actualizacion
';


--
-- TOC entry 9770 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.idmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.idmovil IS 'Movil por el cual se cometio el hecho.';


--
-- TOC entry 9771 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.descripcionmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.descripcionmovil IS 'Descripcion exacta del movil.';


--
-- TOC entry 9772 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.idtipofecha IS 'Tipo de Fecha del hecho';


--
-- TOC entry 9773 (class 0 OID 0)
-- Dependencies: 517
-- Name: COLUMN hecho_audit.descripciontipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN hecho_audit.descripciontipofecha IS 'Descripcion de la fecha.';


--
-- TOC entry 518 (class 1259 OID 87772)
-- Dependencies: 516 11
-- Name: hecho_idhecho_seq1; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE hecho_idhecho_seq1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.hecho_idhecho_seq1 OWNER TO postgres;

--
-- TOC entry 9774 (class 0 OID 0)
-- Dependencies: 518
-- Name: hecho_idhecho_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE hecho_idhecho_seq1 OWNED BY hecho.idhecho;


--
-- TOC entry 277 (class 1259 OID 29043)
-- Dependencies: 11
-- Name: hibernate_sequence; Type: SEQUENCE; Schema: public; Owner: sijyp
--

CREATE SEQUENCE hibernate_sequence
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.hibernate_sequence OWNER TO sijyp;

--
-- TOC entry 519 (class 1259 OID 87774)
-- Dependencies: 11
-- Name: historial_idhistorial_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE historial_idhistorial_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.historial_idhistorial_seq OWNER TO postgres;

--
-- TOC entry 520 (class 1259 OID 87776)
-- Dependencies: 7335 11
-- Name: historialpersonaga; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialpersonaga (
    idhistorial integer DEFAULT nextval('historial_idhistorial_seq'::regclass) NOT NULL,
    idpersona integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    fechainicio date,
    fechafin date,
    idrango integer NOT NULL,
    idrol integer NOT NULL,
    idgrupoarmado integer NOT NULL,
    usuario character varying(10),
    observacion text,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimiento character(100),
    vereda character(100),
    inspeccion character(100),
    finca character(100),
    barrio character(100),
    direccion character(200),
    sitio character(200),
    alias character(100),
    descripcionfecha character(200),
    tipofecha integer,
    idfactoringresoga integer,
    idorigenevento integer
);


ALTER TABLE public.historialpersonaga OWNER TO postgres;

--
-- TOC entry 9775 (class 0 OID 0)
-- Dependencies: 520
-- Name: TABLE historialpersonaga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE historialpersonaga IS 'Historial de una persona atraves del grupo o los grupos armados.';


--
-- TOC entry 9776 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idhistorial IS 'Identificador unico del historial de una persona en el grupo armado.';


--
-- TOC entry 9777 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idpersona IS 'Identificador que relaciona a una persona al historial de persona en el grupo armado.';


--
-- TOC entry 9778 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idestructura IS 'Identificador de relacion de la persona con le estructura del grupo armado.';


--
-- TOC entry 9779 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idbloque IS 'Identificador de relacion de la persona con el bloque del grupo armado.';


--
-- TOC entry 9780 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idfrente IS 'Identificador de relacion de la persona con el frente del grupo armado.';


--
-- TOC entry 9781 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.fechainicio IS 'Fecha en que inicio su pertenencia en el grupo armado descrito.';


--
-- TOC entry 9782 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.fechafin IS 'Fecha en que termino su pertenencia al grupo de armado descrito.';


--
-- TOC entry 9783 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idrango; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idrango IS 'Identificador de relacion entre la persona y el rango.';


--
-- TOC entry 9784 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idrol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idrol IS 'Identificador de relacion entre la persona y el rol.';


--
-- TOC entry 9785 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idgrupoarmado IS 'Identificador de relacion de la persona con el grupo armado.';


--
-- TOC entry 9786 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 9787 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.observacion IS 'Observacion general del historial.';


--
-- TOC entry 9788 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idpais IS 'Identificador de relacion de la persona con el pais en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9789 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.iddepartamento IS 'Identificador de relacion de la persona con el departamento en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9790 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idmunicipio IS 'Identificador de relacion de la persona con el municipio en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9791 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.corregimiento IS 'Relacion del corregimiento en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9792 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.vereda IS 'Relacion de la vereda en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9793 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.inspeccion IS 'Relacion de la inspeccion en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9794 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.finca IS 'Relacion de la finca en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9795 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.barrio IS 'Relacion del barrio en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9796 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.direccion IS 'Relacion de la direccion en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9797 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.sitio IS 'Relacion del sitio de forma general en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9798 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.alias; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.alias IS 'Alias de la persona a la que se le atribuye el historial.';


--
-- TOC entry 9799 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idfactoringresoga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idfactoringresoga IS 'Identificador de relacion de la persona con el factor de ingreso al grupo armado.';


--
-- TOC entry 9800 (class 0 OID 0)
-- Dependencies: 520
-- Name: COLUMN historialpersonaga.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga.idorigenevento IS 'Identificador de relacion del historial con el origen del evento.';


--
-- TOC entry 521 (class 1259 OID 87783)
-- Dependencies: 11
-- Name: historialpersonaga_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialpersonaga_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistorial integer NOT NULL,
    idpersona integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer NOT NULL,
    idfrente integer NOT NULL,
    fechainicio date,
    fechafin date,
    idrango integer NOT NULL,
    idrol integer NOT NULL,
    idgrupoarmado integer NOT NULL,
    usuario character varying(10),
    observacion text,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    corregimiento character(100),
    vereda character(100),
    inspeccion character(100),
    finca character(100),
    barrio character(100),
    direccion character(200),
    sitio character(200),
    alias character(100),
    descripcionfecha character(200),
    tipofecha integer,
    idfactoringresoga integer,
    idorigenevento integer
);


ALTER TABLE public.historialpersonaga_audit OWNER TO postgres;

--
-- TOC entry 9801 (class 0 OID 0)
-- Dependencies: 521
-- Name: TABLE historialpersonaga_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE historialpersonaga_audit IS 'Control del historial de una persona atraves del grupo o los grupos armados.';


--
-- TOC entry 9802 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 9803 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 9804 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idhistorial IS 'Identificador unico del historial de una persona en el grupo armado.';


--
-- TOC entry 9805 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idpersona IS 'Identificador que relaciona a una persona al historial de persona en el grupo armado.';


--
-- TOC entry 9806 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idestructura IS 'Identificador de relacion de la persona con le estructura del grupo armado.';


--
-- TOC entry 9807 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idbloque IS 'Identificador de relacion de la persona con el bloque del grupo armado.';


--
-- TOC entry 9808 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idfrente IS 'Identificador de relacion de la persona con el frente del grupo armado.';


--
-- TOC entry 9809 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.fechainicio IS 'Fecha en que inicio su pertenencia en el grupo armado descrito.';


--
-- TOC entry 9810 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.fechafin IS 'Fecha en que termino su pertenencia al grupo de armado descrito.';


--
-- TOC entry 9811 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idrango; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idrango IS 'Identificador de relacion entre la persona y el rango.';


--
-- TOC entry 9812 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idrol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idrol IS 'Identificador de relacion entre la persona y el rol.';


--
-- TOC entry 9813 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idgrupoarmado IS 'Identificador de relacion de la persona con el grupo armado.';


--
-- TOC entry 9814 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 9815 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.observacion IS 'Observacion general del historial.';


--
-- TOC entry 9816 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idpais IS 'Identificador de relacion de la persona con el pais en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9817 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.iddepartamento IS 'Identificador de relacion de la persona con el departamento en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9818 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idmunicipio IS 'Identificador de relacion de la persona con el municipio en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9819 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.corregimiento IS 'Relacion del corregimiento en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9820 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.vereda IS 'Relacion de la vereda en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9821 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.inspeccion IS 'Relacion de la inspeccion en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9822 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.finca IS 'Relacion de la finca en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9823 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.barrio IS 'Relacion del barrio en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9824 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.direccion IS 'Relacion de la direccion en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9825 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.sitio IS 'Relacion del sitio de forma general en donde ejercio su participacion en el grupo armado.';


--
-- TOC entry 9826 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.alias; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.alias IS 'Alias de la persona a la que se le atribuye el historial.';


--
-- TOC entry 9827 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idfactoringresoga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idfactoringresoga IS 'Identificador de relacion de la persona con el factor de ingreso al grupo armado.';


--
-- TOC entry 9828 (class 0 OID 0)
-- Dependencies: 521
-- Name: COLUMN historialpersonaga_audit.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialpersonaga_audit.idorigenevento IS 'Identificador de relacion del historial con el origen del evento.';


--
-- TOC entry 522 (class 1259 OID 87789)
-- Dependencies: 11
-- Name: historialreclusion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialreclusion (
    idhistorialreclusion integer NOT NULL,
    idpersona integer NOT NULL,
    idtipohistorialreclusion integer NOT NULL,
    fechainicial date,
    fechafinal date,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    lugar character varying(255),
    observaciones text NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.historialreclusion OWNER TO postgres;

--
-- TOC entry 9829 (class 0 OID 0)
-- Dependencies: 522
-- Name: TABLE historialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE historialreclusion IS 'Historial de reclusion de una persona.';


--
-- TOC entry 9830 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.idhistorialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.idhistorialreclusion IS 'Identificador del historial de reclusion';


--
-- TOC entry 9831 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.idpersona IS 'Identificador de la persona';


--
-- TOC entry 9832 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.idtipohistorialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.idtipohistorialreclusion IS 'Identificador del tipo de historial de reclusion';


--
-- TOC entry 9833 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.fechainicial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.fechainicial IS 'Fecha inicial de reclusion';


--
-- TOC entry 9834 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.fechafinal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.fechafinal IS 'Fecha final de reclusion';


--
-- TOC entry 9835 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.idpais IS 'Identificador del pais de reclusion';


--
-- TOC entry 9836 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.iddepartamento IS 'Identificador del departamento de reclusion';


--
-- TOC entry 9837 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.idmunicipio IS 'Identificador del municipio de reclusion';


--
-- TOC entry 9838 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.lugar; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.lugar IS 'Lugar de reclusion';


--
-- TOC entry 9839 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.observaciones; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.observaciones IS 'Observaciones';


--
-- TOC entry 9840 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 9841 (class 0 OID 0)
-- Dependencies: 522
-- Name: COLUMN historialreclusion.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion.ip IS 'Ip de ultima accion.';


--
-- TOC entry 523 (class 1259 OID 87795)
-- Dependencies: 11
-- Name: historialreclusion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialreclusion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistorialreclusion integer,
    idpersona integer,
    idtipohistorialreclusion integer,
    fechainicial date,
    fechafinal date,
    idpais integer,
    iddepartamento integer,
    idmunicipio integer,
    lugar character varying(255),
    observaciones text,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.historialreclusion_audit OWNER TO postgres;

--
-- TOC entry 9842 (class 0 OID 0)
-- Dependencies: 523
-- Name: COLUMN historialreclusion_audit.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialreclusion_audit.ip IS 'Ip de ultima accion.';


--
-- TOC entry 524 (class 1259 OID 87801)
-- Dependencies: 522 11
-- Name: historialreclusion_idhistorialreclusion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE historialreclusion_idhistorialreclusion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.historialreclusion_idhistorialreclusion_seq OWNER TO postgres;

--
-- TOC entry 9843 (class 0 OID 0)
-- Dependencies: 524
-- Name: historialreclusion_idhistorialreclusion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE historialreclusion_idhistorialreclusion_seq OWNED BY historialreclusion.idhistorialreclusion;


--
-- TOC entry 525 (class 1259 OID 87803)
-- Dependencies: 11
-- Name: historialubicacion_idhistorial_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE historialubicacion_idhistorial_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.historialubicacion_idhistorial_seq OWNER TO postgres;

--
-- TOC entry 526 (class 1259 OID 87805)
-- Dependencies: 7337 11
-- Name: historialubicacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialubicacion (
    idhistorial integer DEFAULT nextval('historialubicacion_idhistorial_seq'::regclass) NOT NULL,
    fechainicio date,
    fechafin date,
    idpersona integer NOT NULL,
    idmunicipio integer NOT NULL,
    iddepartamento integer NOT NULL,
    idpais integer NOT NULL,
    direccion character varying(200),
    vereda character varying(100),
    corregimiento character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.historialubicacion OWNER TO postgres;

--
-- TOC entry 9844 (class 0 OID 0)
-- Dependencies: 526
-- Name: TABLE historialubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE historialubicacion IS 'historial ubicacion';


--
-- TOC entry 9845 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.idhistorial IS 'Numero unico identificacion del historial';


--
-- TOC entry 9846 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.fechainicio IS '''Fecha inicio';


--
-- TOC entry 9847 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.fechafin IS 'Fecha final';


--
-- TOC entry 9848 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9849 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9850 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9851 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.idpais IS 'Identificacion del pais';


--
-- TOC entry 9852 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.direccion IS 'Direccion';


--
-- TOC entry 9853 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.vereda IS 'Nombre vereda';


--
-- TOC entry 9854 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.corregimiento IS 'Nombre corregimiento';


--
-- TOC entry 9855 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.inspeccion IS 'Nombre inspeccion';


--
-- TOC entry 9856 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.finca IS 'Nombre finca';


--
-- TOC entry 9857 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.barrio IS 'Nombre del barrio';


--
-- TOC entry 9858 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.sitio IS 'Sitio';


--
-- TOC entry 9859 (class 0 OID 0)
-- Dependencies: 526
-- Name: COLUMN historialubicacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 527 (class 1259 OID 87809)
-- Dependencies: 11
-- Name: historialubicacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historialubicacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistorial bigint NOT NULL,
    fechainicio date,
    fechafin date,
    idpersona integer NOT NULL,
    idmunicipio integer NOT NULL,
    iddepartamento integer NOT NULL,
    idpais integer NOT NULL,
    direccion character varying(200),
    vereda character varying(100),
    corregimiento character varying(100),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.historialubicacion_audit OWNER TO postgres;

--
-- TOC entry 9860 (class 0 OID 0)
-- Dependencies: 527
-- Name: TABLE historialubicacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE historialubicacion_audit IS 'historial ubicacion';


--
-- TOC entry 9861 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9862 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9863 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.idhistorial IS 'Numero unico identificacion del historial';


--
-- TOC entry 9864 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.fechainicio IS 'Fecha inicio';


--
-- TOC entry 9865 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.fechafin IS 'Fecha final';


--
-- TOC entry 9866 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.idpersona IS 'Identificacion de la persona';


--
-- TOC entry 9867 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.idmunicipio IS 'Identificacion del municipio';


--
-- TOC entry 9868 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.iddepartamento IS 'Identificacion del departamento';


--
-- TOC entry 9869 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.idpais IS '''Identificacion del pais';


--
-- TOC entry 9870 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.direccion IS 'Direccion';


--
-- TOC entry 9871 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.vereda IS 'Nombre vereda';


--
-- TOC entry 9872 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.corregimiento IS 'Nombre corregimiento';


--
-- TOC entry 9873 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.inspeccion IS 'Nombre inspeccion';


--
-- TOC entry 9874 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.finca IS 'Nombre finca';


--
-- TOC entry 9875 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.barrio IS 'Nombre del barrio';


--
-- TOC entry 9876 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.sitio IS 'Sitio';


--
-- TOC entry 9877 (class 0 OID 0)
-- Dependencies: 527
-- Name: COLUMN historialubicacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historialubicacion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 528 (class 1259 OID 87812)
-- Dependencies: 11
-- Name: historicodocumentocarpeta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historicodocumentocarpeta (
    fechaactualizacion timestamp without time zone,
    iddocumentocarpeta bigint NOT NULL,
    idtipodocumentocarpeta integer NOT NULL,
    numero character varying(100),
    fecha date,
    nombrearchivo character varying(100),
    usuario character varying(10) NOT NULL,
    numfolio integer,
    observacion text,
    idcarpeta integer NOT NULL
);


ALTER TABLE public.historicodocumentocarpeta OWNER TO postgres;

--
-- TOC entry 529 (class 1259 OID 87818)
-- Dependencies: 11
-- Name: historicopostuladoasignaciongrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historicopostuladoasignaciongrupoarmado (
    idasignaciongrupoarmado integer NOT NULL,
    radicado character varying(21) NOT NULL,
    fecha date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.historicopostuladoasignaciongrupoarmado OWNER TO postgres;

--
-- TOC entry 530 (class 1259 OID 87821)
-- Dependencies: 11
-- Name: historicoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historicoprocesal (
    idhistoricoprocesal integer NOT NULL,
    radicado character varying(21) NOT NULL,
    iddespacho bigint NOT NULL,
    idevento bigint,
    idetapahistoricoprocesal bigint NOT NULL,
    idestadohistoricoprocesal bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.historicoprocesal OWNER TO postgres;

--
-- TOC entry 9878 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.idhistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.idhistoricoprocesal IS 'Identificador unico del historico procesal.';


--
-- TOC entry 9879 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.radicado IS 'Radicado del historico procesal.';


--
-- TOC entry 9880 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.iddespacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.iddespacho IS 'Identificador del despacho donde se encuentra el historico procesal.';


--
-- TOC entry 9881 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.idevento IS 'Identificador del evento al que se relaciona el historico procesal.';


--
-- TOC entry 9882 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.idetapahistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.idetapahistoricoprocesal IS 'Identificador de la etapa en la que se encuentra el historico procesal.';


--
-- TOC entry 9883 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.idestadohistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.idestadohistoricoprocesal IS 'Identificador del estado en la que se encuentra el historico procesal.';


--
-- TOC entry 9884 (class 0 OID 0)
-- Dependencies: 530
-- Name: COLUMN historicoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN historicoprocesal.usuario IS 'Usuario que registra el historico procesal.';


--
-- TOC entry 531 (class 1259 OID 87824)
-- Dependencies: 11
-- Name: historicoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historicoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistoricoprocesal bigint,
    radicado character varying(21),
    iddespacho bigint,
    idevento bigint,
    idetapahistoricoprocesal bigint,
    idestadohistoricoprocesal bigint,
    usuario character varying(10)
);


ALTER TABLE public.historicoprocesal_audit OWNER TO postgres;

--
-- TOC entry 532 (class 1259 OID 87827)
-- Dependencies: 530 11
-- Name: historicoprocesal_idhistoricoprocesal_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE historicoprocesal_idhistoricoprocesal_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.historicoprocesal_idhistoricoprocesal_seq OWNER TO postgres;

--
-- TOC entry 9885 (class 0 OID 0)
-- Dependencies: 532
-- Name: historicoprocesal_idhistoricoprocesal_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE historicoprocesal_idhistoricoprocesal_seq OWNED BY historicoprocesal.idhistoricoprocesal;


--
-- TOC entry 533 (class 1259 OID 87829)
-- Dependencies: 11
-- Name: historicorelacioncarpetahechoevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE historicorelacioncarpetahechoevento (
    fechaactualizacion timestamp without time zone,
    idevento bigint NOT NULL,
    idcarpetahecho bigint NOT NULL,
    idetapaflujoinformacion bigint NOT NULL,
    observacion text NOT NULL,
    fecharelacion date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.historicorelacioncarpetahechoevento OWNER TO postgres;

--
-- TOC entry 534 (class 1259 OID 87835)
-- Dependencies: 11
-- Name: identificacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE identificacion (
    ididentificacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.identificacion OWNER TO postgres;

--
-- TOC entry 9886 (class 0 OID 0)
-- Dependencies: 534
-- Name: TABLE identificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE identificacion IS 'Nombres de las diferentes identificaciones para una persona';


--
-- TOC entry 9887 (class 0 OID 0)
-- Dependencies: 534
-- Name: COLUMN identificacion.ididentificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN identificacion.ididentificacion IS 'Identifcador unico de la identificacion.';


--
-- TOC entry 9888 (class 0 OID 0)
-- Dependencies: 534
-- Name: COLUMN identificacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN identificacion.descripcion IS 'Descripcion de la identificacion.';


--
-- TOC entry 9889 (class 0 OID 0)
-- Dependencies: 534
-- Name: COLUMN identificacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN identificacion.usuario IS 'Usuario que realiza la identificacion.';


--
-- TOC entry 535 (class 1259 OID 87838)
-- Dependencies: 11
-- Name: identificacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE identificacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    ididentificacion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.identificacion_audit OWNER TO postgres;

--
-- TOC entry 536 (class 1259 OID 87841)
-- Dependencies: 534 11
-- Name: identificacion_ididentificacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE identificacion_ididentificacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.identificacion_ididentificacion_seq OWNER TO postgres;

--
-- TOC entry 9890 (class 0 OID 0)
-- Dependencies: 536
-- Name: identificacion_ididentificacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE identificacion_ididentificacion_seq OWNED BY identificacion.ididentificacion;


--
-- TOC entry 537 (class 1259 OID 87843)
-- Dependencies: 11
-- Name: identificaciongrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE identificaciongrupoarmado (
    ididentificaciongrupoarmado integer NOT NULL,
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer,
    idfrente integer,
    idtipoidentificaciongrupoarmado integer NOT NULL,
    rutaarchivo character varying(255) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.identificaciongrupoarmado OWNER TO postgres;

--
-- TOC entry 538 (class 1259 OID 87846)
-- Dependencies: 11
-- Name: identificaciongrupoarmado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE identificaciongrupoarmado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    ididentificaciongrupoarmado integer,
    idgrupoarmado integer NOT NULL,
    idestructura integer NOT NULL,
    idbloque integer,
    idfrente integer,
    idtipoidentificaciongrupoarmado integer NOT NULL,
    rutaarchivo character varying(255) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.identificaciongrupoarmado_audit OWNER TO postgres;

--
-- TOC entry 539 (class 1259 OID 87849)
-- Dependencies: 537 11
-- Name: identificaciongrupoarmado_ididentificaciongrupoarmado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE identificaciongrupoarmado_ididentificaciongrupoarmado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.identificaciongrupoarmado_ididentificaciongrupoarmado_seq OWNER TO postgres;

--
-- TOC entry 9891 (class 0 OID 0)
-- Dependencies: 539
-- Name: identificaciongrupoarmado_ididentificaciongrupoarmado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE identificaciongrupoarmado_ididentificaciongrupoarmado_seq OWNED BY identificaciongrupoarmado.ididentificaciongrupoarmado;


--
-- TOC entry 540 (class 1259 OID 87851)
-- Dependencies: 11
-- Name: jornadaaudiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE jornadaaudiencia (
    idjornadaaudiencia integer NOT NULL,
    idaudiencia integer NOT NULL,
    fecha date,
    usuario character varying(10)
);


ALTER TABLE public.jornadaaudiencia OWNER TO postgres;

--
-- TOC entry 541 (class 1259 OID 87854)
-- Dependencies: 11
-- Name: jornadaaudiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE jornadaaudiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idjornadaaudiencia integer,
    idaudiencia integer,
    fecha date,
    usuario character varying(10)
);


ALTER TABLE public.jornadaaudiencia_audit OWNER TO postgres;

--
-- TOC entry 542 (class 1259 OID 87857)
-- Dependencies: 540 11
-- Name: jornadaaudiencia_idjornadaaudiencia_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE jornadaaudiencia_idjornadaaudiencia_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.jornadaaudiencia_idjornadaaudiencia_seq OWNER TO postgres;

--
-- TOC entry 9892 (class 0 OID 0)
-- Dependencies: 542
-- Name: jornadaaudiencia_idjornadaaudiencia_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE jornadaaudiencia_idjornadaaudiencia_seq OWNED BY jornadaaudiencia.idjornadaaudiencia;


--
-- TOC entry 543 (class 1259 OID 87859)
-- Dependencies: 11
-- Name: listacaracteristica; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE listacaracteristica (
    descripcion character varying(100),
    idtipobien bigint NOT NULL,
    idcaracteristica integer NOT NULL
);


ALTER TABLE public.listacaracteristica OWNER TO postgres;

--
-- TOC entry 9893 (class 0 OID 0)
-- Dependencies: 543
-- Name: TABLE listacaracteristica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE listacaracteristica IS 'Tabla listado caracteristicas del bien';


--
-- TOC entry 9894 (class 0 OID 0)
-- Dependencies: 543
-- Name: COLUMN listacaracteristica.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN listacaracteristica.descripcion IS 'Descripcion del bien';


--
-- TOC entry 9895 (class 0 OID 0)
-- Dependencies: 543
-- Name: COLUMN listacaracteristica.idtipobien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN listacaracteristica.idtipobien IS 'Identificacion tipo de bien';


--
-- TOC entry 9896 (class 0 OID 0)
-- Dependencies: 543
-- Name: COLUMN listacaracteristica.idcaracteristica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN listacaracteristica.idcaracteristica IS 'Identificacion caracteristica del bien';


--
-- TOC entry 544 (class 1259 OID 87862)
-- Dependencies: 543 11
-- Name: listacaracteristica_idcaracteristica_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE listacaracteristica_idcaracteristica_seq
    START WITH 79
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.listacaracteristica_idcaracteristica_seq OWNER TO postgres;

--
-- TOC entry 9897 (class 0 OID 0)
-- Dependencies: 544
-- Name: listacaracteristica_idcaracteristica_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE listacaracteristica_idcaracteristica_seq OWNED BY listacaracteristica.idcaracteristica;


--
-- TOC entry 545 (class 1259 OID 87864)
-- Dependencies: 8857 11
-- Name: login_usuario; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW login_usuario AS
    SELECT usuario.login, usuario.password, usuario.rol FROM usuario WHERE ((usuario.rol)::text = 'sijyp'::text);


ALTER TABLE public.login_usuario OWNER TO postgres;

--
-- TOC entry 546 (class 1259 OID 87868)
-- Dependencies: 11
-- Name: magistrado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE magistrado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idmagistrado integer,
    numeroidentificacion character varying(12),
    primernombre character varying(20),
    segundonombre character varying(20),
    primerapellido character varying(20),
    segundoapellido character varying(20),
    usuario character varying(10)
);


ALTER TABLE public.magistrado_audit OWNER TO postgres;

--
-- TOC entry 547 (class 1259 OID 87871)
-- Dependencies: 326 11
-- Name: magistrado_idmagistrado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE magistrado_idmagistrado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.magistrado_idmagistrado_seq OWNER TO postgres;

--
-- TOC entry 9898 (class 0 OID 0)
-- Dependencies: 547
-- Name: magistrado_idmagistrado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE magistrado_idmagistrado_seq OWNED BY magistrado.idmagistrado;


--
-- TOC entry 548 (class 1259 OID 87873)
-- Dependencies: 11
-- Name: mediopublicacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE mediopublicacion (
    idmediopublicacion integer NOT NULL,
    idtipomediopublicacion integer NOT NULL,
    mediopublicacion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.mediopublicacion OWNER TO postgres;

--
-- TOC entry 549 (class 1259 OID 87876)
-- Dependencies: 11
-- Name: mediopublicacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE mediopublicacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idmediopublicacion integer,
    idtipomediopublicacion integer,
    mediopublicacion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.mediopublicacion_audit OWNER TO postgres;

--
-- TOC entry 550 (class 1259 OID 87879)
-- Dependencies: 548 11
-- Name: mediopublicacion_idmediopublicacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE mediopublicacion_idmediopublicacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.mediopublicacion_idmediopublicacion_seq OWNER TO postgres;

--
-- TOC entry 9899 (class 0 OID 0)
-- Dependencies: 550
-- Name: mediopublicacion_idmediopublicacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE mediopublicacion_idmediopublicacion_seq OWNED BY mediopublicacion.idmediopublicacion;


--
-- TOC entry 551 (class 1259 OID 87881)
-- Dependencies: 11
-- Name: menu_idmenu_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE menu_idmenu_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.menu_idmenu_seq OWNER TO postgres;

--
-- TOC entry 552 (class 1259 OID 87883)
-- Dependencies: 7344 11
-- Name: menu; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE menu (
    menu character varying(50),
    idmenu integer DEFAULT nextval('menu_idmenu_seq'::regclass) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.menu OWNER TO postgres;

--
-- TOC entry 9900 (class 0 OID 0)
-- Dependencies: 552
-- Name: TABLE menu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE menu IS 'Tabla menu';


--
-- TOC entry 9901 (class 0 OID 0)
-- Dependencies: 552
-- Name: COLUMN menu.menu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu.menu IS 'Menu';


--
-- TOC entry 9902 (class 0 OID 0)
-- Dependencies: 552
-- Name: COLUMN menu.idmenu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu.idmenu IS 'Identificacion del menu';


--
-- TOC entry 9903 (class 0 OID 0)
-- Dependencies: 552
-- Name: COLUMN menu.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 553 (class 1259 OID 87887)
-- Dependencies: 11
-- Name: menu_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE menu_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    menu character varying(50),
    idmenu integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.menu_audit OWNER TO postgres;

--
-- TOC entry 9904 (class 0 OID 0)
-- Dependencies: 553
-- Name: TABLE menu_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE menu_audit IS 'Actualizacion o modificacion ded la tabla menu';


--
-- TOC entry 9905 (class 0 OID 0)
-- Dependencies: 553
-- Name: COLUMN menu_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9906 (class 0 OID 0)
-- Dependencies: 553
-- Name: COLUMN menu_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu_audit.fechaactualizacion IS 'fechaactualizacion IS ''Fecha de actualizacion de la accion';


--
-- TOC entry 9907 (class 0 OID 0)
-- Dependencies: 553
-- Name: COLUMN menu_audit.menu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu_audit.menu IS 'Tabla menu';


--
-- TOC entry 9908 (class 0 OID 0)
-- Dependencies: 553
-- Name: COLUMN menu_audit.idmenu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu_audit.idmenu IS 'Identificacion del menu';


--
-- TOC entry 9909 (class 0 OID 0)
-- Dependencies: 553
-- Name: COLUMN menu_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN menu_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 554 (class 1259 OID 87890)
-- Dependencies: 11
-- Name: modusoperandi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE modusoperandi (
    idmodusoperandi integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.modusoperandi OWNER TO postgres;

--
-- TOC entry 9910 (class 0 OID 0)
-- Dependencies: 554
-- Name: TABLE modusoperandi; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE modusoperandi IS 'Tipos de modus operandi.';


--
-- TOC entry 9911 (class 0 OID 0)
-- Dependencies: 554
-- Name: COLUMN modusoperandi.idmodusoperandi; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi.idmodusoperandi IS 'Identificador unico del modus operandi.';


--
-- TOC entry 9912 (class 0 OID 0)
-- Dependencies: 554
-- Name: COLUMN modusoperandi.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi.descripcion IS 'Descripcion del modus operandi.';


--
-- TOC entry 9913 (class 0 OID 0)
-- Dependencies: 554
-- Name: COLUMN modusoperandi.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 555 (class 1259 OID 87893)
-- Dependencies: 11
-- Name: modusoperandi_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE modusoperandi_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idmodusoperandi bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.modusoperandi_audit OWNER TO postgres;

--
-- TOC entry 9914 (class 0 OID 0)
-- Dependencies: 555
-- Name: TABLE modusoperandi_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE modusoperandi_audit IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9915 (class 0 OID 0)
-- Dependencies: 555
-- Name: COLUMN modusoperandi_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9916 (class 0 OID 0)
-- Dependencies: 555
-- Name: COLUMN modusoperandi_audit.idmodusoperandi; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi_audit.idmodusoperandi IS 'Identificador unico del modus operandi.';


--
-- TOC entry 9917 (class 0 OID 0)
-- Dependencies: 555
-- Name: COLUMN modusoperandi_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi_audit.descripcion IS 'Descripcion del modus operandi.';


--
-- TOC entry 9918 (class 0 OID 0)
-- Dependencies: 555
-- Name: COLUMN modusoperandi_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN modusoperandi_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 556 (class 1259 OID 87896)
-- Dependencies: 554 11
-- Name: modusoperandi_idmodusoperandi_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE modusoperandi_idmodusoperandi_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.modusoperandi_idmodusoperandi_seq OWNER TO postgres;

--
-- TOC entry 9919 (class 0 OID 0)
-- Dependencies: 556
-- Name: modusoperandi_idmodusoperandi_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE modusoperandi_idmodusoperandi_seq OWNED BY modusoperandi.idmodusoperandi;


--
-- TOC entry 557 (class 1259 OID 87898)
-- Dependencies: 11
-- Name: motivoterminacionetapapostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE motivoterminacionetapapostulado (
    idmotivoterminacionetapapostulado integer NOT NULL,
    motivoterminacionetapapostulado character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.motivoterminacionetapapostulado OWNER TO postgres;

--
-- TOC entry 558 (class 1259 OID 87901)
-- Dependencies: 557 11
-- Name: motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq OWNER TO postgres;

--
-- TOC entry 9920 (class 0 OID 0)
-- Dependencies: 558
-- Name: motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq OWNED BY motivoterminacionetapapostulado.idmotivoterminacionetapapostulado;


--
-- TOC entry 559 (class 1259 OID 87903)
-- Dependencies: 11
-- Name: motivoterminacionetapapostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE motivoterminacionetapapostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idmotivoterminacionetapapostulado integer,
    motivoterminacionetapapostulado character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.motivoterminacionetapapostulado_audit OWNER TO postgres;

--
-- TOC entry 560 (class 1259 OID 87906)
-- Dependencies: 11
-- Name: movil; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE movil (
    idmovil integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.movil OWNER TO postgres;

--
-- TOC entry 9921 (class 0 OID 0)
-- Dependencies: 560
-- Name: TABLE movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE movil IS 'Tipo de movil de un hecho.';


--
-- TOC entry 9922 (class 0 OID 0)
-- Dependencies: 560
-- Name: COLUMN movil.idmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil.idmovil IS 'Identificador unico del movil.';


--
-- TOC entry 9923 (class 0 OID 0)
-- Dependencies: 560
-- Name: COLUMN movil.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil.descripcion IS 'Descripcion del movil.';


--
-- TOC entry 9924 (class 0 OID 0)
-- Dependencies: 560
-- Name: COLUMN movil.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 561 (class 1259 OID 87909)
-- Dependencies: 11
-- Name: movil_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE movil_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idmovil bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.movil_audit OWNER TO postgres;

--
-- TOC entry 9925 (class 0 OID 0)
-- Dependencies: 561
-- Name: TABLE movil_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE movil_audit IS 'Tipo de movil de un hecho.';


--
-- TOC entry 9926 (class 0 OID 0)
-- Dependencies: 561
-- Name: COLUMN movil_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil_audit.accion IS 'ACCIONES CONTROLADAS
Insertar -I
Borrar-D
Actualizar -X y U
Como estaba -X
Como Quedo -U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9927 (class 0 OID 0)
-- Dependencies: 561
-- Name: COLUMN movil_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil_audit.fechaactualizacion IS 'Fecha de actualizacion de la accion';


--
-- TOC entry 9928 (class 0 OID 0)
-- Dependencies: 561
-- Name: COLUMN movil_audit.idmovil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil_audit.idmovil IS 'Identificador unico del movil.';


--
-- TOC entry 9929 (class 0 OID 0)
-- Dependencies: 561
-- Name: COLUMN movil_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil_audit.descripcion IS 'Descripcion del movil.';


--
-- TOC entry 9930 (class 0 OID 0)
-- Dependencies: 561
-- Name: COLUMN movil_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN movil_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 562 (class 1259 OID 87912)
-- Dependencies: 560 11
-- Name: movil_idmovil_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE movil_idmovil_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.movil_idmovil_seq OWNER TO postgres;

--
-- TOC entry 9931 (class 0 OID 0)
-- Dependencies: 562
-- Name: movil_idmovil_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE movil_idmovil_seq OWNED BY movil.idmovil;


--
-- TOC entry 565 (class 1259 OID 87920)
-- Dependencies: 11
-- Name: nivel; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE nivel (
    idnivel integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.nivel OWNER TO postgres;

--
-- TOC entry 9932 (class 0 OID 0)
-- Dependencies: 565
-- Name: TABLE nivel; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE nivel IS 'Tabla que representa los niveles (Alto Medio Bajo)';


--
-- TOC entry 9933 (class 0 OID 0)
-- Dependencies: 565
-- Name: COLUMN nivel.idnivel; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel.idnivel IS 'Id del Nivel.';


--
-- TOC entry 9934 (class 0 OID 0)
-- Dependencies: 565
-- Name: COLUMN nivel.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel.descripcion IS 'Descripcion del Nivel.';


--
-- TOC entry 9935 (class 0 OID 0)
-- Dependencies: 565
-- Name: COLUMN nivel.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 566 (class 1259 OID 87923)
-- Dependencies: 11
-- Name: nivel_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE nivel_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idnivel bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.nivel_audit OWNER TO postgres;

--
-- TOC entry 9936 (class 0 OID 0)
-- Dependencies: 566
-- Name: TABLE nivel_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE nivel_audit IS 'Tabla que representa los niveles (Alto Medio Bajo)';


--
-- TOC entry 9937 (class 0 OID 0)
-- Dependencies: 566
-- Name: COLUMN nivel_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9938 (class 0 OID 0)
-- Dependencies: 566
-- Name: COLUMN nivel_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 9939 (class 0 OID 0)
-- Dependencies: 566
-- Name: COLUMN nivel_audit.idnivel; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel_audit.idnivel IS 'Identificador unico del nivel';


--
-- TOC entry 9940 (class 0 OID 0)
-- Dependencies: 566
-- Name: COLUMN nivel_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel_audit.descripcion IS 'Descripcion del Nivel';


--
-- TOC entry 9941 (class 0 OID 0)
-- Dependencies: 566
-- Name: COLUMN nivel_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivel_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 567 (class 1259 OID 87926)
-- Dependencies: 565 11
-- Name: nivel_idnivel_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE nivel_idnivel_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.nivel_idnivel_seq OWNER TO postgres;

--
-- TOC entry 9942 (class 0 OID 0)
-- Dependencies: 567
-- Name: nivel_idnivel_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE nivel_idnivel_seq OWNED BY nivel.idnivel;


--
-- TOC entry 568 (class 1259 OID 87928)
-- Dependencies: 11
-- Name: niveleducacion_idniveleducacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE niveleducacion_idniveleducacion_seq
    START WITH 7
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.niveleducacion_idniveleducacion_seq OWNER TO postgres;

--
-- TOC entry 569 (class 1259 OID 87930)
-- Dependencies: 7350 11
-- Name: niveleducacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE niveleducacion (
    idniveleducacion integer DEFAULT nextval('niveleducacion_idniveleducacion_seq'::regclass) NOT NULL,
    niveleducacion character varying(30) NOT NULL
);


ALTER TABLE public.niveleducacion OWNER TO postgres;

--
-- TOC entry 9943 (class 0 OID 0)
-- Dependencies: 569
-- Name: TABLE niveleducacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE niveleducacion IS 'Nivel de educacion de la persona';


--
-- TOC entry 9944 (class 0 OID 0)
-- Dependencies: 569
-- Name: COLUMN niveleducacion.idniveleducacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN niveleducacion.idniveleducacion IS 'Identificador unico del nivel de educacion';


--
-- TOC entry 9945 (class 0 OID 0)
-- Dependencies: 569
-- Name: COLUMN niveleducacion.niveleducacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN niveleducacion.niveleducacion IS 'nivel de educacion';


--
-- TOC entry 570 (class 1259 OID 87934)
-- Dependencies: 7352 11
-- Name: notificacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE notificacion (
    idnotificacion integer NOT NULL,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    inspeccion character varying(100),
    corregimiento character varying(100),
    vereda character varying(100),
    finca character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    telefono character varying(100),
    movil character varying(35),
    idpersona bigint,
    sitio character varying(200),
    usuario character varying(10),
    principal boolean DEFAULT false NOT NULL,
    correo character varying(50),
    ip character varying(15),
    idtipoubicacion integer,
    idpersonajuridicacolectividad integer
);


ALTER TABLE public.notificacion OWNER TO postgres;

--
-- TOC entry 9946 (class 0 OID 0)
-- Dependencies: 570
-- Name: TABLE notificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE notificacion IS 'Notificaciones';


--
-- TOC entry 9947 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idnotificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idnotificacion IS 'Identificador unico del tipo de notificacion';


--
-- TOC entry 9948 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idpais IS 'Identificador unico del pais de la notificacion';


--
-- TOC entry 9949 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.iddepartamento IS 'Identificador unico del departamento de la notificacion';


--
-- TOC entry 9950 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idmunicipio IS 'Identificador unico del municipio de la notificacion';


--
-- TOC entry 9951 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.inspeccion IS 'Inspeccion (lugar) de la notificacion';


--
-- TOC entry 9952 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.corregimiento IS 'Corregimiento de la notificacion';


--
-- TOC entry 9953 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.vereda IS 'Vereda de la notificacion';


--
-- TOC entry 9954 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.finca IS 'Finca de la notificacion';


--
-- TOC entry 9955 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.barrio IS 'Barrio de la notificacion';


--
-- TOC entry 9956 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.direccion IS 'Direccion del lugar de la notificacion';


--
-- TOC entry 9957 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.telefono; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.telefono IS 'Telefono de la persona que hace la notificacion';


--
-- TOC entry 9958 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.movil IS 'Numero de celular de la persona que hace la notificacion';


--
-- TOC entry 9959 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 9960 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.sitio IS 'Sitio de la notificacion';


--
-- TOC entry 9961 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 9962 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.principal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.principal IS 'Notificacion principal';


--
-- TOC entry 9963 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.correo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.correo IS 'Correo electronico de la persona.';


--
-- TOC entry 9964 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idtipoubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idtipoubicacion IS 'Tipo de ubicacion de la persona.';


--
-- TOC entry 9965 (class 0 OID 0)
-- Dependencies: 570
-- Name: COLUMN notificacion.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion.idpersonajuridicacolectividad IS 'Identificacion de la persona juridica o colectividad.';


--
-- TOC entry 571 (class 1259 OID 87938)
-- Dependencies: 7353 11
-- Name: notificacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE notificacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idnotificacion integer NOT NULL,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    inspeccion character varying(100),
    corregimiento character varying(100),
    vereda character varying(100),
    finca character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    telefono character varying(100),
    movil character varying(35),
    idpersona bigint,
    sitio character varying(200),
    usuario character varying(10),
    principal boolean DEFAULT false NOT NULL,
    correo character varying(50),
    ip character varying(15),
    idtipoubicacion integer,
    idpersonajuridicacolectividad integer
);


ALTER TABLE public.notificacion_audit OWNER TO postgres;

--
-- TOC entry 9966 (class 0 OID 0)
-- Dependencies: 571
-- Name: TABLE notificacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE notificacion_audit IS 'Notificaciones';


--
-- TOC entry 9967 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 9968 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 9969 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idnotificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idnotificacion IS 'Identificador unico del pais de la notificacion';


--
-- TOC entry 9970 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idpais IS 'Identificador unico del pais de la notificacion';


--
-- TOC entry 9971 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.iddepartamento IS 'Identificador unico del departamento de la notificacion';


--
-- TOC entry 9972 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idmunicipio IS 'Identificador unico del municipio de la notificacion';


--
-- TOC entry 9973 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.inspeccion IS 'Inspeccion (lugar) de la notificacion';


--
-- TOC entry 9974 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.corregimiento IS 'Corregimiento de la notificacion';


--
-- TOC entry 9975 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.vereda IS 'Vereda de la notificacion';


--
-- TOC entry 9976 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.finca IS 'Finca de la notificacion';


--
-- TOC entry 9977 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.barrio IS 'Barrio de la notificacion';


--
-- TOC entry 9978 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.direccion IS 'Direccion del lugar de la notificacion';


--
-- TOC entry 9979 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.telefono; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.telefono IS 'Telefono de la persona que hace la notificacion';


--
-- TOC entry 9980 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.movil IS 'Numero de celular de la persona que hace la notificacion';


--
-- TOC entry 9981 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 9982 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.sitio IS 'Sitio de la notificacion';


--
-- TOC entry 9983 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 9984 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.principal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.principal IS 'Notificacion principal';


--
-- TOC entry 9985 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.correo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.correo IS 'Correo electronico de la persona.';


--
-- TOC entry 9986 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idtipoubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idtipoubicacion IS 'Tipo de ubicacion de la persona.';


--
-- TOC entry 9987 (class 0 OID 0)
-- Dependencies: 571
-- Name: COLUMN notificacion_audit.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacion_audit.idpersonajuridicacolectividad IS 'Identificacion de la persona juridica o colectividad.';


--
-- TOC entry 572 (class 1259 OID 87944)
-- Dependencies: 570 11
-- Name: notificacion_idnotificacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE notificacion_idnotificacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notificacion_idnotificacion_seq OWNER TO postgres;

--
-- TOC entry 9988 (class 0 OID 0)
-- Dependencies: 572
-- Name: notificacion_idnotificacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE notificacion_idnotificacion_seq OWNED BY notificacion.idnotificacion;


--
-- TOC entry 573 (class 1259 OID 87946)
-- Dependencies: 11
-- Name: notificacioncorreo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE notificacioncorreo (
    idnotificacioncorreo integer NOT NULL,
    remite character varying(100) NOT NULL,
    destinatario character varying(100) NOT NULL,
    fecha date NOT NULL,
    idtipoestadonotificacioncorreo integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.notificacioncorreo OWNER TO postgres;

--
-- TOC entry 9989 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.idnotificacioncorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.idnotificacioncorreo IS 'Identificador unico de la notificacion de correo.';


--
-- TOC entry 9990 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.remite; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.remite IS 'Remitente.';


--
-- TOC entry 9991 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.destinatario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.destinatario IS 'Destinatario.';


--
-- TOC entry 9992 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.fecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.fecha IS 'Fecha de la notificacion.';


--
-- TOC entry 9993 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.idtipoestadonotificacioncorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.idtipoestadonotificacioncorreo IS 'identificador unico del tipo del estado de la notificacion.';


--
-- TOC entry 9994 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.descripcion IS 'Descripcion.';


--
-- TOC entry 9995 (class 0 OID 0)
-- Dependencies: 573
-- Name: COLUMN notificacioncorreo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN notificacioncorreo.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 574 (class 1259 OID 87949)
-- Dependencies: 11
-- Name: notificacioncorreo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE notificacioncorreo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idnotificacioncorreo integer,
    remite character varying(100),
    destinatario character varying(100),
    fecha timestamp without time zone,
    idtipoestadonotificacioncorreo bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.notificacioncorreo_audit OWNER TO postgres;

--
-- TOC entry 575 (class 1259 OID 87952)
-- Dependencies: 573 11
-- Name: notificacioncorreo_idnotificacioncorreo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE notificacioncorreo_idnotificacioncorreo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notificacioncorreo_idnotificacioncorreo_seq OWNER TO postgres;

--
-- TOC entry 9996 (class 0 OID 0)
-- Dependencies: 575
-- Name: notificacioncorreo_idnotificacioncorreo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE notificacioncorreo_idnotificacioncorreo_seq OWNED BY notificacioncorreo.idnotificacioncorreo;


--
-- TOC entry 576 (class 1259 OID 87954)
-- Dependencies: 11
-- Name: origen; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origen (
    idorigen integer NOT NULL,
    descripcion character varying(100)
);


ALTER TABLE public.origen OWNER TO postgres;

--
-- TOC entry 9997 (class 0 OID 0)
-- Dependencies: 576
-- Name: TABLE origen; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origen IS 'Origen del bien';


--
-- TOC entry 9998 (class 0 OID 0)
-- Dependencies: 576
-- Name: COLUMN origen.idorigen; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origen.idorigen IS 'Identificador unico del origen';


--
-- TOC entry 9999 (class 0 OID 0)
-- Dependencies: 576
-- Name: COLUMN origen.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origen.descripcion IS 'Descripcion del origen del bien';


--
-- TOC entry 577 (class 1259 OID 87957)
-- Dependencies: 576 11
-- Name: origen_idorigen_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE origen_idorigen_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.origen_idorigen_seq OWNER TO postgres;

--
-- TOC entry 10000 (class 0 OID 0)
-- Dependencies: 577
-- Name: origen_idorigen_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE origen_idorigen_seq OWNED BY origen.idorigen;


--
-- TOC entry 578 (class 1259 OID 87959)
-- Dependencies: 11
-- Name: origenevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenevento (
    idorigenevento integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.origenevento OWNER TO postgres;

--
-- TOC entry 10001 (class 0 OID 0)
-- Dependencies: 578
-- Name: TABLE origenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenevento IS 'Tipos de Origenes de los Eventos.';


--
-- TOC entry 10002 (class 0 OID 0)
-- Dependencies: 578
-- Name: COLUMN origenevento.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento.idorigenevento IS 'Identificador unico del origen del evento.';


--
-- TOC entry 10003 (class 0 OID 0)
-- Dependencies: 578
-- Name: COLUMN origenevento.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento.descripcion IS 'Descripcion del origen del evento.';


--
-- TOC entry 10004 (class 0 OID 0)
-- Dependencies: 578
-- Name: COLUMN origenevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 579 (class 1259 OID 87962)
-- Dependencies: 11
-- Name: origenevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idorigenevento bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.origenevento_audit OWNER TO postgres;

--
-- TOC entry 10005 (class 0 OID 0)
-- Dependencies: 579
-- Name: TABLE origenevento_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenevento_audit IS 'Tipos de Origenes de los Eventos';


--
-- TOC entry 10006 (class 0 OID 0)
-- Dependencies: 579
-- Name: COLUMN origenevento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10007 (class 0 OID 0)
-- Dependencies: 579
-- Name: COLUMN origenevento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10008 (class 0 OID 0)
-- Dependencies: 579
-- Name: COLUMN origenevento_audit.idorigenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento_audit.idorigenevento IS 'Identificador unico del origen del evento';


--
-- TOC entry 10009 (class 0 OID 0)
-- Dependencies: 579
-- Name: COLUMN origenevento_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento_audit.descripcion IS 'Descripcion del origen del evento';


--
-- TOC entry 10010 (class 0 OID 0)
-- Dependencies: 579
-- Name: COLUMN origenevento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenevento_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 580 (class 1259 OID 87965)
-- Dependencies: 578 11
-- Name: origenevento_idorigenevento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE origenevento_idorigenevento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.origenevento_idorigenevento_seq OWNER TO postgres;

--
-- TOC entry 10011 (class 0 OID 0)
-- Dependencies: 580
-- Name: origenevento_idorigenevento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE origenevento_idorigenevento_seq OWNED BY origenevento.idorigenevento;


--
-- TOC entry 581 (class 1259 OID 87967)
-- Dependencies: 11
-- Name: origenfuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenfuenteinformacion (
    idorigenfuenteinformacion integer NOT NULL,
    descripcion character varying(200) NOT NULL,
    idtipoorigenfuenteinformacion bigint,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.origenfuenteinformacion OWNER TO postgres;

--
-- TOC entry 10012 (class 0 OID 0)
-- Dependencies: 581
-- Name: TABLE origenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenfuenteinformacion IS 'Origen de una fuente de informacionn del proceso de Justicia y Paz';


--
-- TOC entry 10013 (class 0 OID 0)
-- Dependencies: 581
-- Name: COLUMN origenfuenteinformacion.idorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion.idorigenfuenteinformacion IS 'Identifcador unico del origen de una fuente de informacion';


--
-- TOC entry 10014 (class 0 OID 0)
-- Dependencies: 581
-- Name: COLUMN origenfuenteinformacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion.descripcion IS 'Descripcion del origen de una fuente de informacion';


--
-- TOC entry 10015 (class 0 OID 0)
-- Dependencies: 581
-- Name: COLUMN origenfuenteinformacion.idtipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion.idtipoorigenfuenteinformacion IS 'Identificador unico del origen de la fuente de informacion';


--
-- TOC entry 10016 (class 0 OID 0)
-- Dependencies: 581
-- Name: COLUMN origenfuenteinformacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 582 (class 1259 OID 87970)
-- Dependencies: 11
-- Name: origenfuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenfuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idorigenfuenteinformacion bigint,
    descripcion character varying(200),
    idtipoorigenfuenteinformacion bigint,
    usuario character varying(10)
);


ALTER TABLE public.origenfuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 10017 (class 0 OID 0)
-- Dependencies: 582
-- Name: TABLE origenfuenteinformacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenfuenteinformacion_audit IS 'Origen de una fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 10018 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10019 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10020 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.idorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.idorigenfuenteinformacion IS 'Identifcador unico del origen de una fuente de informacion';


--
-- TOC entry 10021 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.descripcion IS 'Descripcion del origen de una fuente de informacion';


--
-- TOC entry 10022 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.idtipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.idtipoorigenfuenteinformacion IS 'Identificador unico del origen de la fuente de informacion';


--
-- TOC entry 10023 (class 0 OID 0)
-- Dependencies: 582
-- Name: COLUMN origenfuenteinformacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenfuenteinformacion_audit.usuario IS 'Usuario que realiza la actualizacioin';


--
-- TOC entry 583 (class 1259 OID 87973)
-- Dependencies: 581 11
-- Name: origenfuenteinformacion_idorigenfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE origenfuenteinformacion_idorigenfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.origenfuenteinformacion_idorigenfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 10024 (class 0 OID 0)
-- Dependencies: 583
-- Name: origenfuenteinformacion_idorigenfuenteinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE origenfuenteinformacion_idorigenfuenteinformacion_seq OWNED BY origenfuenteinformacion.idorigenfuenteinformacion;


--
-- TOC entry 584 (class 1259 OID 87975)
-- Dependencies: 11
-- Name: origenhechoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenhechoversion (
    idorigenhechoversion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.origenhechoversion OWNER TO postgres;

--
-- TOC entry 10025 (class 0 OID 0)
-- Dependencies: 584
-- Name: TABLE origenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenhechoversion IS 'Origenes del hecho dentro de la version.';


--
-- TOC entry 10026 (class 0 OID 0)
-- Dependencies: 584
-- Name: COLUMN origenhechoversion.idorigenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion.idorigenhechoversion IS 'Identificador unico del origen del hecho dentro de la version.';


--
-- TOC entry 10027 (class 0 OID 0)
-- Dependencies: 584
-- Name: COLUMN origenhechoversion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion.descripcion IS 'Descripcion de un origen de un hecho dentro de la version.';


--
-- TOC entry 10028 (class 0 OID 0)
-- Dependencies: 584
-- Name: COLUMN origenhechoversion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 585 (class 1259 OID 87978)
-- Dependencies: 11
-- Name: origenhechoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE origenhechoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idorigenhechoversion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.origenhechoversion_audit OWNER TO postgres;

--
-- TOC entry 10029 (class 0 OID 0)
-- Dependencies: 585
-- Name: TABLE origenhechoversion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE origenhechoversion_audit IS 'Origenes del hecho dentro de la version
';


--
-- TOC entry 10030 (class 0 OID 0)
-- Dependencies: 585
-- Name: COLUMN origenhechoversion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10031 (class 0 OID 0)
-- Dependencies: 585
-- Name: COLUMN origenhechoversion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10032 (class 0 OID 0)
-- Dependencies: 585
-- Name: COLUMN origenhechoversion_audit.idorigenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion_audit.idorigenhechoversion IS 'Identificador unico del origen del hecho dentro de la version';


--
-- TOC entry 10033 (class 0 OID 0)
-- Dependencies: 585
-- Name: COLUMN origenhechoversion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion_audit.descripcion IS 'Descripcion de un origen de un hecho dentro de la version';


--
-- TOC entry 10034 (class 0 OID 0)
-- Dependencies: 585
-- Name: COLUMN origenhechoversion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN origenhechoversion_audit.usuario IS 'Usuario que realiza la ultima actualizacion';


--
-- TOC entry 586 (class 1259 OID 87981)
-- Dependencies: 584 11
-- Name: origenhechoversion_idorigenhechoversion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE origenhechoversion_idorigenhechoversion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.origenhechoversion_idorigenhechoversion_seq OWNER TO postgres;

--
-- TOC entry 10035 (class 0 OID 0)
-- Dependencies: 586
-- Name: origenhechoversion_idorigenhechoversion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE origenhechoversion_idorigenhechoversion_seq OWNED BY origenhechoversion.idorigenhechoversion;


--
-- TOC entry 589 (class 1259 OID 87989)
-- Dependencies: 11
-- Name: partidos_politicos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE partidos_politicos (
    idpartidos_politicos integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.partidos_politicos OWNER TO postgres;

--
-- TOC entry 10036 (class 0 OID 0)
-- Dependencies: 589
-- Name: TABLE partidos_politicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE partidos_politicos IS 'Nombres de las diferentes partidos politicos para identificar a una persona';


--
-- TOC entry 10037 (class 0 OID 0)
-- Dependencies: 589
-- Name: COLUMN partidos_politicos.idpartidos_politicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN partidos_politicos.idpartidos_politicos IS 'Identifcador unico del partido politico.';


--
-- TOC entry 10038 (class 0 OID 0)
-- Dependencies: 589
-- Name: COLUMN partidos_politicos.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN partidos_politicos.descripcion IS 'Descripcion de la partido politico.';


--
-- TOC entry 10039 (class 0 OID 0)
-- Dependencies: 589
-- Name: COLUMN partidos_politicos.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN partidos_politicos.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 590 (class 1259 OID 87992)
-- Dependencies: 11
-- Name: partidos_politicos_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE partidos_politicos_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpartidos_politicos bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.partidos_politicos_audit OWNER TO postgres;

--
-- TOC entry 591 (class 1259 OID 87995)
-- Dependencies: 589 11
-- Name: partidos_politicos_idpartidos_politicos_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE partidos_politicos_idpartidos_politicos_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.partidos_politicos_idpartidos_politicos_seq OWNER TO postgres;

--
-- TOC entry 10040 (class 0 OID 0)
-- Dependencies: 591
-- Name: partidos_politicos_idpartidos_politicos_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE partidos_politicos_idpartidos_politicos_seq OWNED BY partidos_politicos.idpartidos_politicos;


--
-- TOC entry 592 (class 1259 OID 87997)
-- Dependencies: 11
-- Name: perfil_idperfil_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE perfil_idperfil_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.perfil_idperfil_seq OWNER TO postgres;

--
-- TOC entry 593 (class 1259 OID 87999)
-- Dependencies: 7361 11
-- Name: perfil; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE perfil (
    idperfil integer DEFAULT nextval('perfil_idperfil_seq'::regclass) NOT NULL,
    perfil character varying(50) NOT NULL
);


ALTER TABLE public.perfil OWNER TO postgres;

--
-- TOC entry 10041 (class 0 OID 0)
-- Dependencies: 593
-- Name: TABLE perfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE perfil IS 'Perfil del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10042 (class 0 OID 0)
-- Dependencies: 593
-- Name: COLUMN perfil.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN perfil.idperfil IS 'Identificador unico del perfil del usuario del sistema de informacion Justicia y Paz';


--
-- TOC entry 10043 (class 0 OID 0)
-- Dependencies: 593
-- Name: COLUMN perfil.perfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN perfil.perfil IS 'Perfil del usuario de usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 594 (class 1259 OID 88003)
-- Dependencies: 11
-- Name: persona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE persona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    numeroidentificacion character varying(12),
    primernombre character varying(20) NOT NULL,
    segundonombre character varying(20),
    primerapellido character varying(20) NOT NULL,
    segundoapellido character varying(20),
    alias character varying(200),
    direccion character varying(200),
    telefono character varying(40),
    mail character varying(40),
    vereda character varying(60),
    corregimiento character varying(100),
    fechanacimiento date,
    idpersona integer NOT NULL,
    fechaexpedicion date,
    idtipopersona integer NOT NULL,
    iddocumentodeidentidad integer,
    idpaisdocumentodeidentidad integer,
    idmunicipiodocumentodeidentidad integer,
    idpaisdenacimiento integer,
    idmunicipionacimiento integer,
    idestadocivil integer,
    idniveleducacion integer,
    idprofesion integer,
    iddepartamentodocumentodeidentidad integer,
    idfuenteinformacion integer,
    iddepartamentonacimineto integer,
    idgruposanguineo integer,
    idpaisdireccion integer,
    iddepartamentodireccion integer,
    idmunicipiodireccion integer,
    estado character varying(60) NOT NULL,
    foto integer,
    idgenero character varying(1),
    oficio character varying(200),
    inspecciondireccion character varying(100),
    barriodireccion character varying(100),
    fincadireccion character varying(100),
    usuario character varying(10),
    idraza integer,
    idreligion integer,
    idpartido_politico integer,
    ididentificacion integer,
    idgrupos_etnicos integer,
    idtendenciasexual integer,
    permisosms boolean,
    ip character varying(15),
    observacion character varying(250),
    idtipodiscapacidad integer,
    movil character varying(35),
    sitiodireccion character varying(200),
    idtipoclasificacionpersonajuridica integer,
    idtiposubclasificacionpersonajuridica integer
);


ALTER TABLE public.persona_audit OWNER TO postgres;

--
-- TOC entry 10044 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10045 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10046 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.numeroidentificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.numeroidentificacion IS 'Numero de identificacion';


--
-- TOC entry 10047 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.primernombre IS 'Primer nombre de la persona';


--
-- TOC entry 10048 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.segundonombre IS 'Segundo nombre de la persona';


--
-- TOC entry 10049 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.primerapellido IS 'Primer apellido de la persona';


--
-- TOC entry 10050 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.segundoapellido IS 'Segundo apellido de la persona';


--
-- TOC entry 10051 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.alias; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.alias IS 'Alias con el que es conocido la persona';


--
-- TOC entry 10052 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.direccion IS 'Direccion de residencia de la persona';


--
-- TOC entry 10053 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.telefono; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.telefono IS 'Telefono de la residencia de la persona';


--
-- TOC entry 10054 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.mail; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.mail IS 'Correo electronico de la persona';


--
-- TOC entry 10055 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.vereda IS 'Vereda donde habita la persona';


--
-- TOC entry 10056 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.corregimiento IS 'Corregimiento donde habita la persona';


--
-- TOC entry 10057 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.fechanacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.fechanacimiento IS 'Fecha de nacimiento de la persona';


--
-- TOC entry 10058 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10059 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.fechaexpedicion IS 'Fecha de expedicion de la cedula';


--
-- TOC entry 10060 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idtipopersona IS 'Identificador unico de la persona';


--
-- TOC entry 10061 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.iddocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.iddocumentodeidentidad IS 'Identificador unico del tipo de documento de identidad';


--
-- TOC entry 10062 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idpaisdocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idpaisdocumentodeidentidad IS 'Identificador unico del pais de expedicion del documento de identidad';


--
-- TOC entry 10063 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idmunicipiodocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idmunicipiodocumentodeidentidad IS 'Identificador unico del municipio de expedicion del documento de identidad
';


--
-- TOC entry 10064 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idpaisdenacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idpaisdenacimiento IS 'Identificador unico del pais de nacimiento de la persona';


--
-- TOC entry 10065 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idmunicipionacimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idmunicipionacimiento IS 'Identificador unico del municipio de nacimiento de la persona
';


--
-- TOC entry 10066 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idestadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idestadocivil IS 'Identificador unico del Estado civil de la persona';


--
-- TOC entry 10067 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idniveleducacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idniveleducacion IS 'Identificador unico del nivel de educacion de la persona';


--
-- TOC entry 10068 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idprofesion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idprofesion IS 'Identificador unico de la profesion de la persona';


--
-- TOC entry 10069 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.iddepartamentodocumentodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.iddepartamentodocumentodeidentidad IS 'Identificador unico del departamento de expedicion del documento de identidad';


--
-- TOC entry 10070 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idfuenteinformacion IS 'Identificador unico de la fuente de informacion';


--
-- TOC entry 10071 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.iddepartamentonacimineto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.iddepartamentonacimineto IS 'Identificador unico del departamento de nacimiento de la persona';


--
-- TOC entry 10072 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idgruposanguineo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idgruposanguineo IS 'Identificador  unico del grupo sanguineo de la persona';


--
-- TOC entry 10073 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idpaisdireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idpaisdireccion IS 'Identificador unico de la direccion del pais de contacto de la persona';


--
-- TOC entry 10074 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.iddepartamentodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.iddepartamentodireccion IS 'Identificador unico del departamento de la direccion de la persona';


--
-- TOC entry 10075 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idmunicipiodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idmunicipiodireccion IS 'Identificador unico del municipio de la direccion de la persona';


--
-- TOC entry 10076 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.estado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.estado IS 'Estado actual de la persona vivo, muerto.. etc';


--
-- TOC entry 10077 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.foto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.foto IS 'Fotografia de la persona';


--
-- TOC entry 10078 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idgenero; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idgenero IS 'Identificador unico del genero';


--
-- TOC entry 10079 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.oficio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.oficio IS 'Oficio al cual se dedica la persona';


--
-- TOC entry 10080 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.inspecciondireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.inspecciondireccion IS 'Inspeccion (lugar) de direccion de domicilio de la persona';


--
-- TOC entry 10081 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.barriodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.barriodireccion IS 'Barrio en el cual se encuentra la direccion del domicilio de la persona';


--
-- TOC entry 10082 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.fincadireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.fincadireccion IS 'Finca en la cual se encuentra la direccion del domicilio de la persona';


--
-- TOC entry 10083 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 10084 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.movil IS 'Movil de la persona.';


--
-- TOC entry 10085 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.sitiodireccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.sitiodireccion IS 'Sitio de direccion de la persona';


--
-- TOC entry 10086 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idtipoclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idtipoclasificacionpersonajuridica IS 'Tipo de discapacidad';


--
-- TOC entry 10087 (class 0 OID 0)
-- Dependencies: 594
-- Name: COLUMN persona_audit.idtiposubclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN persona_audit.idtiposubclasificacionpersonajuridica IS 'Tipo de discapacidad';


--
-- TOC entry 595 (class 1259 OID 88009)
-- Dependencies: 11
-- Name: personacambiodeidentidad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personacambiodeidentidad (
    idpersonacambioidentidad integer NOT NULL,
    idpersona integer NOT NULL,
    primernombre character varying(50) NOT NULL,
    segundonombre character varying(50),
    primerapellido character varying(50) NOT NULL,
    segundoapellido character varying(50),
    idtipodocumentoidentidad integer,
    numerodocumentoidentidad character varying(20),
    fechaexpedicion date,
    idpaisdocumento integer,
    iddepartamentodocumento integer,
    idmunicipiodocumento integer,
    justificacion text NOT NULL,
    iddocumentopersona integer NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.personacambiodeidentidad OWNER TO postgres;

--
-- TOC entry 10088 (class 0 OID 0)
-- Dependencies: 595
-- Name: TABLE personacambiodeidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personacambiodeidentidad IS 'Cambio de identidad de persona';


--
-- TOC entry 10089 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.idpersonacambioidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.idpersonacambioidentidad IS 'Identificador cambio de identidad';


--
-- TOC entry 10090 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.idpersona IS 'Identificador de la persona';


--
-- TOC entry 10091 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.primernombre IS 'Primer Nombre';


--
-- TOC entry 10092 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.segundonombre IS 'Segundo nombre';


--
-- TOC entry 10093 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.primerapellido IS 'Primer apellido';


--
-- TOC entry 10094 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.segundoapellido IS 'Segundo apellido';


--
-- TOC entry 10095 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.idtipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.idtipodocumentoidentidad IS 'Tipo de documento de identidad';


--
-- TOC entry 10096 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.numerodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.numerodocumentoidentidad IS 'Numero de documento de identidad.';


--
-- TOC entry 10097 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.fechaexpedicion IS 'Fecha de expedicion documento de identidad.';


--
-- TOC entry 10098 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.idpaisdocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.idpaisdocumento IS 'Pais expedicion de documento.';


--
-- TOC entry 10099 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.iddepartamentodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.iddepartamentodocumento IS 'Departamento expedicion de documento.';


--
-- TOC entry 10100 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.idmunicipiodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.idmunicipiodocumento IS 'Municipio expedicion de documento.';


--
-- TOC entry 10101 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.justificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.justificacion IS 'Justificacion cambio de identidad.';


--
-- TOC entry 10102 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.iddocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.iddocumentopersona IS 'Documento soporte justificacion.';


--
-- TOC entry 10103 (class 0 OID 0)
-- Dependencies: 595
-- Name: COLUMN personacambiodeidentidad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 596 (class 1259 OID 88015)
-- Dependencies: 11
-- Name: personacambiodeidentidad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personacambiodeidentidad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonacambioidentidad integer,
    idpersona integer,
    primernombre character varying(50),
    segundonombre character varying(50),
    primerapellido character varying(50),
    segundoapellido character varying(50),
    idtipodocumentoidentidad integer,
    numerodocumentoidentidad character varying(20),
    fechaexpedicion date,
    idpaisdocumento integer,
    iddepartamentodocumento integer,
    idmunicipiodocumento integer,
    justificacion text,
    iddocumentopersona integer,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.personacambiodeidentidad_audit OWNER TO postgres;

--
-- TOC entry 10104 (class 0 OID 0)
-- Dependencies: 596
-- Name: TABLE personacambiodeidentidad_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personacambiodeidentidad_audit IS 'Cambio de identidad de persona';


--
-- TOC entry 10105 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.idpersonacambioidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.idpersonacambioidentidad IS 'Identificador cambio de identidad';


--
-- TOC entry 10106 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.idpersona IS 'Identificador de la persona';


--
-- TOC entry 10107 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.primernombre IS 'Primer Nombre';


--
-- TOC entry 10108 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.segundonombre IS 'Segundo nombre';


--
-- TOC entry 10109 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.primerapellido IS 'Primer apellido';


--
-- TOC entry 10110 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.segundoapellido IS 'Segundo apellido';


--
-- TOC entry 10111 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.idtipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.idtipodocumentoidentidad IS 'Tipo de documento de identidad';


--
-- TOC entry 10112 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.numerodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.numerodocumentoidentidad IS 'Numero de documento de identidad.';


--
-- TOC entry 10113 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.fechaexpedicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.fechaexpedicion IS 'Fecha de expedicion documento de identidad.';


--
-- TOC entry 10114 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.idpaisdocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.idpaisdocumento IS 'Pais expedicion de documento.';


--
-- TOC entry 10115 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.iddepartamentodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.iddepartamentodocumento IS 'Departamento expedicion de documento.';


--
-- TOC entry 10116 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.idmunicipiodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.idmunicipiodocumento IS 'Municipio expedicion de documento.';


--
-- TOC entry 10117 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.justificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.justificacion IS 'Justificacion cambio de identidad.';


--
-- TOC entry 10118 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.iddocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.iddocumentopersona IS 'Documento soporte justificacion.';


--
-- TOC entry 10119 (class 0 OID 0)
-- Dependencies: 596
-- Name: COLUMN personacambiodeidentidad_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personacambiodeidentidad_audit.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 597 (class 1259 OID 88021)
-- Dependencies: 595 11
-- Name: personacambiodeidentidad_idpersonacambioidentidad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personacambiodeidentidad_idpersonacambioidentidad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personacambiodeidentidad_idpersonacambioidentidad_seq OWNER TO postgres;

--
-- TOC entry 10120 (class 0 OID 0)
-- Dependencies: 597
-- Name: personacambiodeidentidad_idpersonacambioidentidad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personacambiodeidentidad_idpersonacambioidentidad_seq OWNED BY personacambiodeidentidad.idpersonacambioidentidad;


--
-- TOC entry 598 (class 1259 OID 88023)
-- Dependencies: 7364 11
-- Name: personaestadohistorico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personaestadohistorico (
    idpersonaestadohistorico integer NOT NULL,
    idpersona integer,
    idtipoestadopersona character varying(60) NOT NULL,
    observacion character varying(250),
    fechacambioestado date DEFAULT now() NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15),
    idpersonajuridicacolectividad integer
);


ALTER TABLE public.personaestadohistorico OWNER TO postgres;

--
-- TOC entry 10121 (class 0 OID 0)
-- Dependencies: 598
-- Name: TABLE personaestadohistorico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personaestadohistorico IS 'Historial de cambios de estado.';


--
-- TOC entry 10122 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.idpersonaestadohistorico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.idpersonaestadohistorico IS 'Identificador del historial de estados de la persona.';


--
-- TOC entry 10123 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.idpersona IS 'Persona.';


--
-- TOC entry 10124 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.idtipoestadopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.idtipoestadopersona IS 'Estado de la persona.';


--
-- TOC entry 10125 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.observacion IS 'Observacion del cambio de estado.';


--
-- TOC entry 10126 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.fechacambioestado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.fechacambioestado IS 'Fecha de cambio de estado.';


--
-- TOC entry 10127 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 10128 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.ip IS 'Ip de ultima accion.';


--
-- TOC entry 10129 (class 0 OID 0)
-- Dependencies: 598
-- Name: COLUMN personaestadohistorico.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadohistorico.idpersonajuridicacolectividad IS 'Identificador de la persona juridica o colectividad.';


--
-- TOC entry 599 (class 1259 OID 88027)
-- Dependencies: 11
-- Name: personaestadohistorico_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personaestadohistorico_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonaestadohistorico integer,
    idpersona integer,
    idtipoestadopersona character varying(60),
    observacion character varying(250),
    fechacambioestado date,
    usuario character varying(10),
    ip character varying(15),
    idpersonajuridicacolectividad integer
);


ALTER TABLE public.personaestadohistorico_audit OWNER TO postgres;

--
-- TOC entry 600 (class 1259 OID 88030)
-- Dependencies: 598 11
-- Name: personaestadohistorico_idpersonaestadohistorico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personaestadohistorico_idpersonaestadohistorico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personaestadohistorico_idpersonaestadohistorico_seq OWNER TO postgres;

--
-- TOC entry 10130 (class 0 OID 0)
-- Dependencies: 600
-- Name: personaestadohistorico_idpersonaestadohistorico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personaestadohistorico_idpersonaestadohistorico_seq OWNED BY personaestadohistorico.idpersonaestadohistorico;


--
-- TOC entry 601 (class 1259 OID 88032)
-- Dependencies: 7366 11
-- Name: personaestadosocioeconomico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personaestadosocioeconomico (
    idpersonaestadosocioeconomico integer NOT NULL,
    idpersona integer NOT NULL,
    embarazada boolean,
    idtiposectortrabajo integer,
    ingresos numeric(12,2),
    idtipomoneda integer,
    idtiponivelsisben integer,
    idtipoaccesosalud integer NOT NULL,
    fecharegistro date DEFAULT now() NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.personaestadosocioeconomico OWNER TO postgres;

--
-- TOC entry 10131 (class 0 OID 0)
-- Dependencies: 601
-- Name: TABLE personaestadosocioeconomico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personaestadosocioeconomico IS 'Estado socioeconomico de la persona.';


--
-- TOC entry 10132 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idpersonaestadosocioeconomico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idpersonaestadosocioeconomico IS 'Identificador del estado socioeconomico de la persona.';


--
-- TOC entry 10133 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idpersona IS 'Persona.';


--
-- TOC entry 10134 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.embarazada; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.embarazada IS 'La persona esta embarazada.';


--
-- TOC entry 10135 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idtiposectortrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idtiposectortrabajo IS 'Tipo de sector de trabajo de la persona.';


--
-- TOC entry 10136 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.ingresos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.ingresos IS 'Ingresos de la persona.';


--
-- TOC entry 10137 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idtipomoneda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idtipomoneda IS 'Tipo moneda de ingreso de la persona.';


--
-- TOC entry 10138 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idtiponivelsisben; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idtiponivelsisben IS 'Tipo de nivel del SISBEN.';


--
-- TOC entry 10139 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.idtipoaccesosalud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.idtipoaccesosalud IS 'Tipo de acceso a saliud de la persona.';


--
-- TOC entry 10140 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.fecharegistro; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.fecharegistro IS 'Fecha del estado socioeconomico.';


--
-- TOC entry 10141 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 10142 (class 0 OID 0)
-- Dependencies: 601
-- Name: COLUMN personaestadosocioeconomico.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personaestadosocioeconomico.ip IS 'Ip de ultima accion.';


--
-- TOC entry 602 (class 1259 OID 88036)
-- Dependencies: 11
-- Name: personaestadosocioeconomico_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personaestadosocioeconomico_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonaestadosocioeconomico integer,
    idpersona integer,
    embarazada boolean,
    idtiposectortrabajo integer,
    ingresos numeric(12,2),
    idtipomoneda integer,
    idtiponivelsisben integer,
    idtipoaccesosalud integer,
    fecharegistro date,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.personaestadosocioeconomico_audit OWNER TO postgres;

--
-- TOC entry 603 (class 1259 OID 88039)
-- Dependencies: 601 11
-- Name: personaestadosocioeconomico_idpersonaestadosocioeconomico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personaestadosocioeconomico_idpersonaestadosocioeconomico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personaestadosocioeconomico_idpersonaestadosocioeconomico_seq OWNER TO postgres;

--
-- TOC entry 10143 (class 0 OID 0)
-- Dependencies: 603
-- Name: personaestadosocioeconomico_idpersonaestadosocioeconomico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personaestadosocioeconomico_idpersonaestadosocioeconomico_seq OWNED BY personaestadosocioeconomico.idpersonaestadosocioeconomico;


--
-- TOC entry 604 (class 1259 OID 88041)
-- Dependencies: 11
-- Name: personajuridicacolectividad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personajuridicacolectividad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonajuridicacolectividad integer,
    idtipopersona integer,
    nombre character varying(50),
    idtipodocumentoidentidad integer,
    numerodocumento character varying(20),
    fechaexpedicion date,
    idpaisexpedicion integer,
    iddepartamentoexpedicion integer,
    idmunicipioexpedicion integer,
    idtipoclasificacionpersonajuridica integer,
    idtiposubclasificacionpersonajuridica integer,
    fechaconstitucion date,
    idtipoestadopersona character varying(60),
    usuario character varying(10),
    ip character varying(15),
    observacion text
);


ALTER TABLE public.personajuridicacolectividad_audit OWNER TO postgres;

--
-- TOC entry 605 (class 1259 OID 88047)
-- Dependencies: 330 11
-- Name: personajuridicacolectividad_idpersonajuridicacolectividad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personajuridicacolectividad_idpersonajuridicacolectividad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personajuridicacolectividad_idpersonajuridicacolectividad_seq OWNER TO postgres;

--
-- TOC entry 10144 (class 0 OID 0)
-- Dependencies: 605
-- Name: personajuridicacolectividad_idpersonajuridicacolectividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personajuridicacolectividad_idpersonajuridicacolectividad_seq OWNED BY personajuridicacolectividad.idpersonajuridicacolectividad;


--
-- TOC entry 606 (class 1259 OID 88049)
-- Dependencies: 11
-- Name: personajuridicacolectividadcorreo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personajuridicacolectividadcorreo (
    idpersonajuridicacolectividadcorreo integer NOT NULL,
    idpersonajuridicacolectividad integer NOT NULL,
    correo character varying(100) NOT NULL,
    principal boolean NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.personajuridicacolectividadcorreo OWNER TO postgres;

--
-- TOC entry 10145 (class 0 OID 0)
-- Dependencies: 606
-- Name: TABLE personajuridicacolectividadcorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE personajuridicacolectividadcorreo IS 'Correo electronico de la persona juridica o colectividad.';


--
-- TOC entry 10146 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.idpersonajuridicacolectividadcorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.idpersonajuridicacolectividadcorreo IS 'Identificador de correo de la persona juridica o colectividad.';


--
-- TOC entry 10147 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.idpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.idpersonajuridicacolectividad IS 'Persona juridica o colectividad.';


--
-- TOC entry 10148 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.correo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.correo IS 'Correo electronico de la persona juridica o colectividad.';


--
-- TOC entry 10149 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.principal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.principal IS 'Correo electronico principal.';


--
-- TOC entry 10150 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 10151 (class 0 OID 0)
-- Dependencies: 606
-- Name: COLUMN personajuridicacolectividadcorreo.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN personajuridicacolectividadcorreo.ip IS 'IP desde la que se realiza la ultima accion.';


--
-- TOC entry 607 (class 1259 OID 88052)
-- Dependencies: 606 11
-- Name: personajuridicacolectividadco_idpersonajuridicacolectividad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personajuridicacolectividadco_idpersonajuridicacolectividad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personajuridicacolectividadco_idpersonajuridicacolectividad_seq OWNER TO postgres;

--
-- TOC entry 10152 (class 0 OID 0)
-- Dependencies: 607
-- Name: personajuridicacolectividadco_idpersonajuridicacolectividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personajuridicacolectividadco_idpersonajuridicacolectividad_seq OWNED BY personajuridicacolectividadcorreo.idpersonajuridicacolectividadcorreo;


--
-- TOC entry 608 (class 1259 OID 88054)
-- Dependencies: 11
-- Name: personajuridicacolectividadcorreo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personajuridicacolectividadcorreo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonajuridicacolectividadcorreo integer,
    idpersonajuridicacolectividad integer,
    correo character varying(100),
    principal boolean,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.personajuridicacolectividadcorreo_audit OWNER TO postgres;

--
-- TOC entry 609 (class 1259 OID 88057)
-- Dependencies: 8858 11
-- Name: pg_buffercache; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW pg_buffercache AS
    SELECT p.bufferid, p.relfilenode, p.reltablespace, p.reldatabase, p.relblocknumber, p.isdirty, p.usagecount FROM pg_buffercache_pages() p(bufferid integer, relfilenode oid, reltablespace oid, reldatabase oid, relblocknumber bigint, isdirty boolean, usagecount smallint);


ALTER TABLE public.pg_buffercache OWNER TO postgres;

--
-- TOC entry 610 (class 1259 OID 88061)
-- Dependencies: 7368 11
-- Name: postulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    postulado bigint,
    fiscal character varying(10),
    despacho bigint,
    fechaasignacion date,
    idetapaproceso bigint,
    idsede bigint,
    idgrupoarmado bigint,
    idestructura bigint,
    idbloque bigint,
    idfrente bigint,
    idnivelseguridad bigint,
    usuario character varying(10),
    esmiembrorepresentante boolean,
    fuecomandante boolean,
    estaprivadolibertad boolean,
    idtipopostulado integer,
    lista integer,
    idversionratifica integer,
    ratificado boolean,
    fecharecepcion date,
    estadopostulado boolean,
    idtipoinactivopostulado integer,
    idtipopreclusionpostulado integer,
    observacion character varying(100),
    reasignacion boolean DEFAULT false NOT NULL,
    numerogrupotrabajo integer,
    adicionaraimputacion boolean,
    fecharatificacion date
);


ALTER TABLE public.postulado_audit OWNER TO postgres;

--
-- TOC entry 10153 (class 0 OID 0)
-- Dependencies: 610
-- Name: TABLE postulado_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE postulado_audit IS 'Persona postulada a la ley 975 de Justicia y paz';


--
-- TOC entry 10154 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10155 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10156 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.radicado IS 'Numero de radicado en el proceso de justicia y paz';


--
-- TOC entry 10157 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.postulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.postulado IS 'Persona postulada a la ley 975 de justicia y paz';


--
-- TOC entry 10158 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.fiscal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.fiscal IS 'Fiscal dentro de la Unidad nacional de fiscalias para la Justicia y la Paz al cual se encuentra asignado el postulado';


--
-- TOC entry 10159 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.despacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.despacho IS 'Despacho de la Unidad Nacional de Fiscalias para la Justicia y la Paz a la cual se encuentra asignado el postulado';


--
-- TOC entry 10160 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.fechaasignacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.fechaasignacion IS 'Fecha en la cual fue asignado el postulado a un fiscal o despacho de la Unidad Nacional de Fiscalias para la Justicia y la Paz';


--
-- TOC entry 10161 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idetapaproceso IS 'Identificador unico de la Etapa en la cual se encuentra el proceso de Justicia y Paz';


--
-- TOC entry 10162 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idsede; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idsede IS 'Identificador unico de la Sede donde se encuentra el proceso dentro de Justicia y Paz';


--
-- TOC entry 10163 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idgrupoarmado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idgrupoarmado IS 'Identificador unico del Grupo armado en el cual se desmovilizo';


--
-- TOC entry 10164 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idestructura; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idestructura IS 'Identificador unico de la Estructura en la cual se desmovilizo';


--
-- TOC entry 10165 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idbloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idbloque IS 'Identificador unico del Bloque con el cual se desmovilizo
';


--
-- TOC entry 10166 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idfrente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idfrente IS 'Identificador unico del Frente con el cual se desmovilizo';


--
-- TOC entry 10167 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.idnivelseguridad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.idnivelseguridad IS 'Identificador unico del Nivel de seguridad que requiere el postulado';


--
-- TOC entry 10168 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 10169 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.esmiembrorepresentante; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.esmiembrorepresentante IS 'Responde si el postulado es miembro representante. (0 Si, 1 No)';


--
-- TOC entry 10170 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.fuecomandante; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.fuecomandante IS 'Responde si el postulado fue comandante de algun grupo armado (0 Si, 1 No)';


--
-- TOC entry 10171 (class 0 OID 0)
-- Dependencies: 610
-- Name: COLUMN postulado_audit.estaprivadolibertad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postulado_audit.estaprivadolibertad IS 'Responde si el postulado se encuentra privado de la libertad. (0 Si, 1 No)';


--
-- TOC entry 611 (class 1259 OID 88065)
-- Dependencies: 7369 7370 7371 7372 7373 11
-- Name: postuladoasignacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postuladoasignacion (
    idpostuladoasignacion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    fiscal character varying(10) NOT NULL,
    despacho integer NOT NULL,
    idsede integer,
    idgrupoarmado integer DEFAULT 0 NOT NULL,
    idestructura integer DEFAULT 0 NOT NULL,
    idbloque integer DEFAULT 0 NOT NULL,
    idfrente integer DEFAULT 0 NOT NULL,
    usuario character varying(10) NOT NULL,
    idresolucionasignacion integer NOT NULL,
    estado boolean DEFAULT true NOT NULL
);


ALTER TABLE public.postuladoasignacion OWNER TO postgres;

--
-- TOC entry 612 (class 1259 OID 88073)
-- Dependencies: 7375 7376 7377 7378 11
-- Name: postuladoasignacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postuladoasignacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpostuladoasignacion integer,
    radicado character varying(21) NOT NULL,
    fiscal character varying(10) NOT NULL,
    despacho integer NOT NULL,
    idsede integer,
    idgrupoarmado integer DEFAULT 0 NOT NULL,
    idestructura integer DEFAULT 0 NOT NULL,
    idbloque integer DEFAULT 0 NOT NULL,
    idfrente integer DEFAULT 0 NOT NULL,
    usuario character varying(10),
    idresolucionasignacion integer,
    estado boolean
);


ALTER TABLE public.postuladoasignacion_audit OWNER TO postgres;

--
-- TOC entry 613 (class 1259 OID 88080)
-- Dependencies: 611 11
-- Name: postuladoasignacion_idpostuladoasignacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE postuladoasignacion_idpostuladoasignacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.postuladoasignacion_idpostuladoasignacion_seq OWNER TO postgres;

--
-- TOC entry 10172 (class 0 OID 0)
-- Dependencies: 613
-- Name: postuladoasignacion_idpostuladoasignacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE postuladoasignacion_idpostuladoasignacion_seq OWNED BY postuladoasignacion.idpostuladoasignacion;


--
-- TOC entry 614 (class 1259 OID 88082)
-- Dependencies: 7379 11
-- Name: postuladoeventoaudiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postuladoeventoaudiencia (
    idevento integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10),
    tratadoversion boolean DEFAULT false NOT NULL,
    politica boolean,
    orden boolean,
    directriz boolean,
    estatuto boolean
);


ALTER TABLE public.postuladoeventoaudiencia OWNER TO postgres;

--
-- TOC entry 10173 (class 0 OID 0)
-- Dependencies: 614
-- Name: COLUMN postuladoeventoaudiencia.tratadoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postuladoeventoaudiencia.tratadoversion IS 'Determina si el hecho a imputar es dirigido a un postulado que no lo trato en version libre';


--
-- TOC entry 10174 (class 0 OID 0)
-- Dependencies: 614
-- Name: COLUMN postuladoeventoaudiencia.politica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postuladoeventoaudiencia.politica IS 'Opcion el hecho a imputar es dirigido a un postulado que no lo trato en version libre';


--
-- TOC entry 10175 (class 0 OID 0)
-- Dependencies: 614
-- Name: COLUMN postuladoeventoaudiencia.orden; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postuladoeventoaudiencia.orden IS 'Opcion el hecho a imputar es dirigido a un postulado que no lo trato en version libre';


--
-- TOC entry 10176 (class 0 OID 0)
-- Dependencies: 614
-- Name: COLUMN postuladoeventoaudiencia.directriz; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postuladoeventoaudiencia.directriz IS 'Opcion el hecho a imputar es dirigido a un postulado que no lo trato en version libre';


--
-- TOC entry 10177 (class 0 OID 0)
-- Dependencies: 614
-- Name: COLUMN postuladoeventoaudiencia.estatuto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postuladoeventoaudiencia.estatuto IS 'Opcion del hecho a imputar es dirigido a un postulado que no lo trato en version libre';


--
-- TOC entry 615 (class 1259 OID 88086)
-- Dependencies: 11
-- Name: postuladoeventoaudiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postuladoeventoaudiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento integer,
    radicado character varying(21),
    usuario character varying(10),
    tratadoversion boolean,
    politica boolean,
    orden boolean,
    directriz boolean,
    estatuto boolean
);


ALTER TABLE public.postuladoeventoaudiencia_audit OWNER TO postgres;

--
-- TOC entry 616 (class 1259 OID 88089)
-- Dependencies: 11
-- Name: procedenciausuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE procedenciausuario (
    idprocedenciausuario integer NOT NULL,
    procedenciausuario character varying(100) NOT NULL
);


ALTER TABLE public.procedenciausuario OWNER TO postgres;

--
-- TOC entry 10178 (class 0 OID 0)
-- Dependencies: 616
-- Name: TABLE procedenciausuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE procedenciausuario IS 'Ciudad de procedencia del usuario';


--
-- TOC entry 10179 (class 0 OID 0)
-- Dependencies: 616
-- Name: COLUMN procedenciausuario.idprocedenciausuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN procedenciausuario.idprocedenciausuario IS 'Identificador unico de la ciudad de procedencia del usuario';


--
-- TOC entry 10180 (class 0 OID 0)
-- Dependencies: 616
-- Name: COLUMN procedenciausuario.procedenciausuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN procedenciausuario.procedenciausuario IS 'Ciudad de procedencia del usuario';


--
-- TOC entry 617 (class 1259 OID 88092)
-- Dependencies: 616 11
-- Name: procedenciausuario_idprocedenciausuario_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE procedenciausuario_idprocedenciausuario_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.procedenciausuario_idprocedenciausuario_seq OWNER TO postgres;

--
-- TOC entry 10181 (class 0 OID 0)
-- Dependencies: 617
-- Name: procedenciausuario_idprocedenciausuario_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE procedenciausuario_idprocedenciausuario_seq OWNED BY procedenciausuario.idprocedenciausuario;


--
-- TOC entry 618 (class 1259 OID 88094)
-- Dependencies: 11
-- Name: profesion_idprofesion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE profesion_idprofesion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.profesion_idprofesion_seq OWNER TO postgres;

--
-- TOC entry 619 (class 1259 OID 88096)
-- Dependencies: 7381 11
-- Name: profesion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE profesion (
    idprofesion integer DEFAULT nextval('profesion_idprofesion_seq'::regclass) NOT NULL,
    profesion character varying(30) NOT NULL
);


ALTER TABLE public.profesion OWNER TO postgres;

--
-- TOC entry 10182 (class 0 OID 0)
-- Dependencies: 619
-- Name: TABLE profesion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE profesion IS 'Profesion de la persona';


--
-- TOC entry 10183 (class 0 OID 0)
-- Dependencies: 619
-- Name: COLUMN profesion.idprofesion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN profesion.idprofesion IS 'Identificador unico de la profesion';


--
-- TOC entry 10184 (class 0 OID 0)
-- Dependencies: 619
-- Name: COLUMN profesion.profesion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN profesion.profesion IS 'Nombre de la profesion';


--
-- TOC entry 620 (class 1259 OID 88100)
-- Dependencies: 11
-- Name: programacionreporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE programacionreporte (
    idprogramacionreporte integer NOT NULL,
    idestadoprogramacionreporte integer,
    usuario character varying(10),
    fecha timestamp without time zone
);


ALTER TABLE public.programacionreporte OWNER TO postgres;

--
-- TOC entry 621 (class 1259 OID 88103)
-- Dependencies: 11
-- Name: programacionreporte_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE programacionreporte_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idprogramacionreporte integer,
    idestadoprogramacionreporte integer,
    usuario character varying(10),
    fecha timestamp without time zone
);


ALTER TABLE public.programacionreporte_audit OWNER TO postgres;

--
-- TOC entry 622 (class 1259 OID 88106)
-- Dependencies: 620 11
-- Name: programacionreporte_idprogramacionreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE programacionreporte_idprogramacionreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.programacionreporte_idprogramacionreporte_seq OWNER TO postgres;

--
-- TOC entry 10185 (class 0 OID 0)
-- Dependencies: 622
-- Name: programacionreporte_idprogramacionreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE programacionreporte_idprogramacionreporte_seq OWNED BY programacionreporte.idprogramacionreporte;


--
-- TOC entry 623 (class 1259 OID 88108)
-- Dependencies: 11
-- Name: publicacionexterna; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE publicacionexterna (
    idpublicacionexterna integer NOT NULL,
    idmediopublicacion integer NOT NULL,
    fecha date NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.publicacionexterna OWNER TO postgres;

--
-- TOC entry 624 (class 1259 OID 88111)
-- Dependencies: 11
-- Name: publicacionexterna_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE publicacionexterna_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpublicacionexterna integer,
    idmediopublicacion integer,
    fecha date NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.publicacionexterna_audit OWNER TO postgres;

--
-- TOC entry 625 (class 1259 OID 88114)
-- Dependencies: 623 11
-- Name: publicacionexterna_idpublicacionexterna_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE publicacionexterna_idpublicacionexterna_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.publicacionexterna_idpublicacionexterna_seq OWNER TO postgres;

--
-- TOC entry 10186 (class 0 OID 0)
-- Dependencies: 625
-- Name: publicacionexterna_idpublicacionexterna_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE publicacionexterna_idpublicacionexterna_seq OWNED BY publicacionexterna.idpublicacionexterna;


--
-- TOC entry 626 (class 1259 OID 88116)
-- Dependencies: 11
-- Name: publicacioninterna; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE publicacioninterna (
    idpublicacioninterna integer NOT NULL,
    idmediopublicacion integer NOT NULL,
    fecha date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.publicacioninterna OWNER TO postgres;

--
-- TOC entry 627 (class 1259 OID 88119)
-- Dependencies: 11
-- Name: publicacioninterna_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE publicacioninterna_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpublicacioninterna integer,
    idmediopublicacion integer,
    fecha date NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.publicacioninterna_audit OWNER TO postgres;

--
-- TOC entry 628 (class 1259 OID 88122)
-- Dependencies: 626 11
-- Name: publicacioninterna_idpublicacioninterna_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE publicacioninterna_idpublicacioninterna_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.publicacioninterna_idpublicacioninterna_seq OWNER TO postgres;

--
-- TOC entry 10187 (class 0 OID 0)
-- Dependencies: 628
-- Name: publicacioninterna_idpublicacioninterna_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE publicacioninterna_idpublicacioninterna_seq OWNED BY publicacioninterna.idpublicacioninterna;


--
-- TOC entry 629 (class 1259 OID 88124)
-- Dependencies: 11
-- Name: rango_idrango_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE rango_idrango_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.rango_idrango_seq OWNER TO postgres;

--
-- TOC entry 630 (class 1259 OID 88126)
-- Dependencies: 7385 11
-- Name: rango; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE rango (
    idrango integer DEFAULT nextval('rango_idrango_seq'::regclass) NOT NULL,
    rango character varying(60) NOT NULL
);


ALTER TABLE public.rango OWNER TO postgres;

--
-- TOC entry 10188 (class 0 OID 0)
-- Dependencies: 630
-- Name: TABLE rango; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE rango IS 'Rango';


--
-- TOC entry 10189 (class 0 OID 0)
-- Dependencies: 630
-- Name: COLUMN rango.idrango; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN rango.idrango IS 'Identificador unico del rango';


--
-- TOC entry 10190 (class 0 OID 0)
-- Dependencies: 630
-- Name: COLUMN rango.rango; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN rango.rango IS 'Rango';


--
-- TOC entry 631 (class 1259 OID 88130)
-- Dependencies: 11
-- Name: raza; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE raza (
    idraza integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.raza OWNER TO postgres;

--
-- TOC entry 10191 (class 0 OID 0)
-- Dependencies: 631
-- Name: TABLE raza; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE raza IS 'Nombres de las diferentes razas para identificar a una persona';


--
-- TOC entry 10192 (class 0 OID 0)
-- Dependencies: 631
-- Name: COLUMN raza.idraza; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN raza.idraza IS 'Identifcador unico de la raza.';


--
-- TOC entry 10193 (class 0 OID 0)
-- Dependencies: 631
-- Name: COLUMN raza.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN raza.descripcion IS 'Descripcion de la raza.';


--
-- TOC entry 10194 (class 0 OID 0)
-- Dependencies: 631
-- Name: COLUMN raza.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN raza.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 632 (class 1259 OID 88133)
-- Dependencies: 11
-- Name: raza_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE raza_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idraza bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.raza_audit OWNER TO postgres;

--
-- TOC entry 633 (class 1259 OID 88136)
-- Dependencies: 631 11
-- Name: raza_idraza_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE raza_idraza_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raza_idraza_seq OWNER TO postgres;

--
-- TOC entry 10195 (class 0 OID 0)
-- Dependencies: 633
-- Name: raza_idraza_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE raza_idraza_seq OWNED BY raza.idraza;


--
-- TOC entry 634 (class 1259 OID 88138)
-- Dependencies: 11
-- Name: region; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE region (
    idregion bigint NOT NULL,
    region character varying(100),
    descripcion character varying(250),
    activo character varying(1) NOT NULL
);


ALTER TABLE public.region OWNER TO postgres;

--
-- TOC entry 10196 (class 0 OID 0)
-- Dependencies: 634
-- Name: TABLE region; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE region IS 'Tabla de Region del cuerpo';


--
-- TOC entry 10197 (class 0 OID 0)
-- Dependencies: 634
-- Name: COLUMN region.idregion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN region.idregion IS 'Identificador unico de la region del cuerpo';


--
-- TOC entry 10198 (class 0 OID 0)
-- Dependencies: 634
-- Name: COLUMN region.region; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN region.region IS 'Region del cuerpo';


--
-- TOC entry 948 (class 1259 OID 96031)
-- Dependencies: 11
-- Name: region_idregion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE region_idregion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.region_idregion_seq OWNER TO postgres;

--
-- TOC entry 635 (class 1259 OID 88141)
-- Dependencies: 7388 11
-- Name: registrohecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE registrohecho (
    idregistrohecho integer NOT NULL,
    fecharegistrohecho date,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    hora character varying(10),
    idevento bigint,
    usuario character varying(10),
    fecharegistrosistema date,
    idfuenteinformacion bigint,
    jornadavictimas smallint DEFAULT 0 NOT NULL
);


ALTER TABLE public.registrohecho OWNER TO postgres;

--
-- TOC entry 10199 (class 0 OID 0)
-- Dependencies: 635
-- Name: TABLE registrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE registrohecho IS 'Registro de un hecho';


--
-- TOC entry 10200 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.idregistrohecho IS 'Identificador unico de un hecho';


--
-- TOC entry 10201 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.fecharegistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.fecharegistrohecho IS 'Fecha de registro de un hecho';


--
-- TOC entry 10202 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.idpais IS 'Identificador unico del pais de ocurrencia del hecho';


--
-- TOC entry 10203 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.iddepartamento IS 'Identificador unico del departamento de ocurrencia del hecho';


--
-- TOC entry 10204 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.idmunicipio IS 'Identificador unico del municipio de ocurrencia del hecho';


--
-- TOC entry 10205 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.hora; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.hora IS 'Hora de ocurrencia de los hechos';


--
-- TOC entry 10206 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10207 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10208 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.fecharegistrosistema; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.fecharegistrosistema IS 'Fecha en la que se registra en el sistema el hecho';


--
-- TOC entry 10209 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.idfuenteinformacion IS 'Identificador unico de la fuente de informacion';


--
-- TOC entry 10210 (class 0 OID 0)
-- Dependencies: 635
-- Name: COLUMN registrohecho.jornadavictimas; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho.jornadavictimas IS '0 No, 1 SI';


--
-- TOC entry 636 (class 1259 OID 88145)
-- Dependencies: 11
-- Name: registrohecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE registrohecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idregistrohecho integer NOT NULL,
    fecharegistrohecho date,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    hora character varying(10),
    idevento bigint,
    usuario character varying(10),
    fecharegistrosistema date,
    idfuenteinformacion bigint,
    jornadavictimas smallint
);


ALTER TABLE public.registrohecho_audit OWNER TO postgres;

--
-- TOC entry 10211 (class 0 OID 0)
-- Dependencies: 636
-- Name: TABLE registrohecho_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE registrohecho_audit IS 'Registro de un hecho';


--
-- TOC entry 10212 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10213 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10214 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.idregistrohecho IS 'Identificador unico de un hecho';


--
-- TOC entry 10215 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.fecharegistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.fecharegistrohecho IS 'Fecha de registro de un hecho';


--
-- TOC entry 10216 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.idpais IS 'Identificador unico del pais de ocurrencia del hecho';


--
-- TOC entry 10217 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.iddepartamento IS 'Identificador unico del departamento de ocurrencia del hecho';


--
-- TOC entry 10218 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.idmunicipio IS 'Identificador unico del municipio de ocurrencia del hecho';


--
-- TOC entry 10219 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.hora; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.hora IS 'Hora de ocurrencia de los hechos';


--
-- TOC entry 10220 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10221 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10222 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.fecharegistrosistema; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.fecharegistrosistema IS 'Fecha en la que se registra en el sistema el hecho';


--
-- TOC entry 10223 (class 0 OID 0)
-- Dependencies: 636
-- Name: COLUMN registrohecho_audit.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN registrohecho_audit.idfuenteinformacion IS 'Identificador unico de la fuente de informacion';


--
-- TOC entry 637 (class 1259 OID 88148)
-- Dependencies: 635 11
-- Name: registrohecho_idregistrohecho_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE registrohecho_idregistrohecho_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.registrohecho_idregistrohecho_seq OWNER TO postgres;

--
-- TOC entry 10224 (class 0 OID 0)
-- Dependencies: 637
-- Name: registrohecho_idregistrohecho_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE registrohecho_idregistrohecho_seq OWNED BY registrohecho.idregistrohecho;


--
-- TOC entry 638 (class 1259 OID 88150)
-- Dependencies: 11
-- Name: relacionactuacionhistoricoprocesalpersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionactuacionhistoricoprocesalpersona (
    idhistoricoprocesaldecision bigint NOT NULL,
    idpersona bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionactuacionhistoricoprocesalpersona OWNER TO postgres;

--
-- TOC entry 10225 (class 0 OID 0)
-- Dependencies: 638
-- Name: COLUMN relacionactuacionhistoricoprocesalpersona.idhistoricoprocesaldecision; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionactuacionhistoricoprocesalpersona.idhistoricoprocesaldecision IS 'Identificador de la actuacion historico procesal.';


--
-- TOC entry 10226 (class 0 OID 0)
-- Dependencies: 638
-- Name: COLUMN relacionactuacionhistoricoprocesalpersona.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionactuacionhistoricoprocesalpersona.idpersona IS 'Identificador de la persona.';


--
-- TOC entry 10227 (class 0 OID 0)
-- Dependencies: 638
-- Name: COLUMN relacionactuacionhistoricoprocesalpersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionactuacionhistoricoprocesalpersona.usuario IS 'Identificador del usuario que creo la relacion.';


--
-- TOC entry 639 (class 1259 OID 88153)
-- Dependencies: 11
-- Name: relacionactuacionhistoricoprocesalpersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionactuacionhistoricoprocesalpersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistoricoprocesaldecision bigint,
    idpersona bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacionactuacionhistoricoprocesalpersona_audit OWNER TO postgres;

--
-- TOC entry 640 (class 1259 OID 88156)
-- Dependencies: 11
-- Name: relacionalbumfotograficofoto; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionalbumfotograficofoto (
    idfoto integer NOT NULL,
    idalbumfotografico integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionalbumfotograficofoto OWNER TO postgres;

--
-- TOC entry 10228 (class 0 OID 0)
-- Dependencies: 640
-- Name: TABLE relacionalbumfotograficofoto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionalbumfotograficofoto IS 'Relacion entre el album fotografico y la foto.';


--
-- TOC entry 10229 (class 0 OID 0)
-- Dependencies: 640
-- Name: COLUMN relacionalbumfotograficofoto.idfoto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionalbumfotograficofoto.idfoto IS 'Identificador de la foto.';


--
-- TOC entry 10230 (class 0 OID 0)
-- Dependencies: 640
-- Name: COLUMN relacionalbumfotograficofoto.idalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionalbumfotograficofoto.idalbumfotografico IS 'Identificador del album.';


--
-- TOC entry 10231 (class 0 OID 0)
-- Dependencies: 640
-- Name: COLUMN relacionalbumfotograficofoto.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionalbumfotograficofoto.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 641 (class 1259 OID 88159)
-- Dependencies: 11
-- Name: relacionalbumfotograficofoto_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionalbumfotograficofoto_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfoto integer,
    idalbumfotografico integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionalbumfotograficofoto_audit OWNER TO postgres;

--
-- TOC entry 642 (class 1259 OID 88162)
-- Dependencies: 7390 7391 7392 11
-- Name: relacionaudienciacarpeta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciacarpeta (
    idrelacionaudienciacarpeta integer NOT NULL,
    idcarpetahecho integer,
    idjornadaaudiencia integer,
    idevento integer,
    aceptadoporelpostulado boolean DEFAULT false,
    hechossuspendejusticiao boolean DEFAULT false,
    idetapaprocesoretorno integer DEFAULT 0 NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciacarpeta OWNER TO postgres;

--
-- TOC entry 10232 (class 0 OID 0)
-- Dependencies: 642
-- Name: COLUMN relacionaudienciacarpeta.aceptadoporelpostulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionaudienciacarpeta.aceptadoporelpostulado IS 'identifica si al hecho fue aceptado Por El Postulado o no(true:si,false:no)';


--
-- TOC entry 10233 (class 0 OID 0)
-- Dependencies: 642
-- Name: COLUMN relacionaudienciacarpeta.hechossuspendejusticiao; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionaudienciacarpeta.hechossuspendejusticiao IS 'identifica si al hecho se suspende en la justicia ordinaria o no(true:si,false:no)';


--
-- TOC entry 10234 (class 0 OID 0)
-- Dependencies: 642
-- Name: COLUMN relacionaudienciacarpeta.idetapaprocesoretorno; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionaudienciacarpeta.idetapaprocesoretorno IS 'identifica la etapa del proceso a la cual la sala lo devuelve';


--
-- TOC entry 643 (class 1259 OID 88168)
-- Dependencies: 11
-- Name: relacionaudienciacarpeta_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciacarpeta_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idrelacionaudienciacarpeta integer NOT NULL,
    idcarpetahecho integer,
    idaudiencia integer,
    idevento integer,
    aceptadoporelpostulado boolean,
    hechossuspendejusticiao boolean,
    idetapaprocesoretorno integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciacarpeta_audit OWNER TO postgres;

--
-- TOC entry 644 (class 1259 OID 88171)
-- Dependencies: 642 11
-- Name: relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq OWNER TO postgres;

--
-- TOC entry 10235 (class 0 OID 0)
-- Dependencies: 644
-- Name: relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq OWNED BY relacionaudienciacarpeta.idrelacionaudienciacarpeta;


--
-- TOC entry 645 (class 1259 OID 88173)
-- Dependencies: 11
-- Name: relacionaudienciafiscal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciafiscal (
    fiscal character varying(10) NOT NULL,
    idaudiencia integer NOT NULL,
    despacho integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciafiscal OWNER TO postgres;

--
-- TOC entry 646 (class 1259 OID 88176)
-- Dependencies: 11
-- Name: relacionaudienciafiscal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciafiscal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    fiscal character varying(10),
    idaudiencia integer,
    despacho integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciafiscal_audit OWNER TO postgres;

--
-- TOC entry 647 (class 1259 OID 88179)
-- Dependencies: 11
-- Name: relacionaudienciaradicado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciaradicado (
    radicado character varying(21) NOT NULL,
    idaudiencia integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciaradicado OWNER TO postgres;

--
-- TOC entry 648 (class 1259 OID 88182)
-- Dependencies: 11
-- Name: relacionaudienciaradicado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionaudienciaradicado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    idaudiencia integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionaudienciaradicado_audit OWNER TO postgres;

--
-- TOC entry 649 (class 1259 OID 88185)
-- Dependencies: 11
-- Name: relacionautorevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionautorevento (
    idevento integer NOT NULL,
    idpersona integer NOT NULL,
    tipoautor character varying(100) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionautorevento OWNER TO postgres;

--
-- TOC entry 10236 (class 0 OID 0)
-- Dependencies: 649
-- Name: TABLE relacionautorevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionautorevento IS 'Relacion del autor en un evento';


--
-- TOC entry 10237 (class 0 OID 0)
-- Dependencies: 649
-- Name: COLUMN relacionautorevento.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10238 (class 0 OID 0)
-- Dependencies: 649
-- Name: COLUMN relacionautorevento.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10239 (class 0 OID 0)
-- Dependencies: 649
-- Name: COLUMN relacionautorevento.tipoautor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento.tipoautor IS 'Tipo de autor del evento';


--
-- TOC entry 10240 (class 0 OID 0)
-- Dependencies: 649
-- Name: COLUMN relacionautorevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 650 (class 1259 OID 88188)
-- Dependencies: 11
-- Name: relacionautorevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionautorevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento integer NOT NULL,
    idpersona integer NOT NULL,
    tipoautor character varying(100) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionautorevento_audit OWNER TO postgres;

--
-- TOC entry 10241 (class 0 OID 0)
-- Dependencies: 650
-- Name: TABLE relacionautorevento_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionautorevento_audit IS 'Relacion del autor en un evento';


--
-- TOC entry 10242 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10243 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10244 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10245 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10246 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.tipoautor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.tipoautor IS 'Tipo de autor del evento';


--
-- TOC entry 10247 (class 0 OID 0)
-- Dependencies: 650
-- Name: COLUMN relacionautorevento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorevento_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 651 (class 1259 OID 88191)
-- Dependencies: 11
-- Name: relacionautorhecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionautorhecho (
    idpersona bigint NOT NULL,
    idhecho bigint NOT NULL,
    idtipoparticipacion bigint NOT NULL,
    idcalidadvictima bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionautorhecho OWNER TO postgres;

--
-- TOC entry 10248 (class 0 OID 0)
-- Dependencies: 651
-- Name: TABLE relacionautorhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionautorhecho IS 'Relacion del autor de un hecho con el hecho.';


--
-- TOC entry 10249 (class 0 OID 0)
-- Dependencies: 651
-- Name: COLUMN relacionautorhecho.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho.idpersona IS 'Identificador de la persona (Autor).';


--
-- TOC entry 10250 (class 0 OID 0)
-- Dependencies: 651
-- Name: COLUMN relacionautorhecho.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho.idhecho IS 'Identificador del hecho.';


--
-- TOC entry 10251 (class 0 OID 0)
-- Dependencies: 651
-- Name: COLUMN relacionautorhecho.idtipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho.idtipoparticipacion IS 'Tipo de participacion del autor en el hecho.';


--
-- TOC entry 10252 (class 0 OID 0)
-- Dependencies: 651
-- Name: COLUMN relacionautorhecho.idcalidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho.idcalidadvictima IS 'Calidad que tenia el autor en el momento de los hecho.';


--
-- TOC entry 10253 (class 0 OID 0)
-- Dependencies: 651
-- Name: COLUMN relacionautorhecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 652 (class 1259 OID 88194)
-- Dependencies: 11
-- Name: relacionautorhecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionautorhecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersona bigint,
    idhecho bigint,
    idtipoparticipacion bigint,
    idcalidadvictima bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacionautorhecho_audit OWNER TO postgres;

--
-- TOC entry 10254 (class 0 OID 0)
-- Dependencies: 652
-- Name: TABLE relacionautorhecho_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionautorhecho_audit IS 'Relacion del autor de un hecho con el hecho';


--
-- TOC entry 10255 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10256 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10257 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.idpersona IS 'Identificador unico de la persona (Autor)
';


--
-- TOC entry 10258 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10259 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.idtipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.idtipoparticipacion IS 'Identificador unico del Tipo de participacion del autor en el hecho';


--
-- TOC entry 10260 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.idcalidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.idcalidadvictima IS 'Identificador unico de la Calidad que tenia el autor en el momento de los hechos';


--
-- TOC entry 10261 (class 0 OID 0)
-- Dependencies: 652
-- Name: COLUMN relacionautorhecho_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionautorhecho_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 653 (class 1259 OID 88197)
-- Dependencies: 11
-- Name: relacionbienhecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionbienhecho (
    idbien bigint NOT NULL,
    idhecho bigint NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionbienhecho OWNER TO postgres;

--
-- TOC entry 10262 (class 0 OID 0)
-- Dependencies: 653
-- Name: TABLE relacionbienhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionbienhecho IS 'Tabla de Relacion de un bien con un hecho';


--
-- TOC entry 10263 (class 0 OID 0)
-- Dependencies: 653
-- Name: COLUMN relacionbienhecho.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho.idbien IS 'Identificador unico del bien';


--
-- TOC entry 10264 (class 0 OID 0)
-- Dependencies: 653
-- Name: COLUMN relacionbienhecho.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10265 (class 0 OID 0)
-- Dependencies: 653
-- Name: COLUMN relacionbienhecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 654 (class 1259 OID 88200)
-- Dependencies: 11
-- Name: relacionbienhecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionbienhecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idbien bigint NOT NULL,
    idhecho bigint NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionbienhecho_audit OWNER TO postgres;

--
-- TOC entry 10266 (class 0 OID 0)
-- Dependencies: 654
-- Name: TABLE relacionbienhecho_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionbienhecho_audit IS 'Relacion de un bien con un hecho';


--
-- TOC entry 10267 (class 0 OID 0)
-- Dependencies: 654
-- Name: COLUMN relacionbienhecho_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10268 (class 0 OID 0)
-- Dependencies: 654
-- Name: COLUMN relacionbienhecho_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10269 (class 0 OID 0)
-- Dependencies: 654
-- Name: COLUMN relacionbienhecho_audit.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho_audit.idbien IS 'Identificador unico del bien';


--
-- TOC entry 10270 (class 0 OID 0)
-- Dependencies: 654
-- Name: COLUMN relacionbienhecho_audit.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho_audit.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10271 (class 0 OID 0)
-- Dependencies: 654
-- Name: COLUMN relacionbienhecho_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionbienhecho_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 655 (class 1259 OID 88203)
-- Dependencies: 11
-- Name: relacioncarpetahechoevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncarpetahechoevento (
    idevento bigint NOT NULL,
    idcarpetahecho bigint NOT NULL,
    idetapaflujoinformacion bigint NOT NULL,
    observacion text NOT NULL,
    fecharelacion date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioncarpetahechoevento OWNER TO postgres;

--
-- TOC entry 10272 (class 0 OID 0)
-- Dependencies: 655
-- Name: TABLE relacioncarpetahechoevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacioncarpetahechoevento IS 'Relacion de un hecho con la carpeta que lo contiene.';


--
-- TOC entry 10273 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.idevento IS 'Hecho que se adjunta a la carpeta.';


--
-- TOC entry 10274 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.idcarpetahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.idcarpetahecho IS 'Numero de la carpeta al que se le relacionan los hechos.';


--
-- TOC entry 10275 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.idetapaflujoinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.idetapaflujoinformacion IS 'Hace referencia a la etapa de la fuente de informacion';


--
-- TOC entry 10276 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.observacion IS 'Observaciion general del por que relacion hecho a la carpeta, aplica tambien para la unificacion de carpetas.';


--
-- TOC entry 10277 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.fecharelacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.fecharelacion IS 'Fecha en la que se realiza la relacion entre la carpeta y el hecho.';


--
-- TOC entry 10278 (class 0 OID 0)
-- Dependencies: 655
-- Name: COLUMN relacioncarpetahechoevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncarpetahechoevento.usuario IS 'Usuario que realiza la ultima actualizacion.';


--
-- TOC entry 656 (class 1259 OID 88209)
-- Dependencies: 11
-- Name: relacioncarpetahechoevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncarpetahechoevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento bigint,
    idcarpetahecho bigint,
    idetapaflujoinformacion bigint,
    observacion text,
    fecharelacion date,
    usuario character varying(10)
);


ALTER TABLE public.relacioncarpetahechoevento_audit OWNER TO postgres;

--
-- TOC entry 657 (class 1259 OID 88215)
-- Dependencies: 11
-- Name: relacioncausadecisionterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncausadecisionterminacionprocesopostulado (
    idcausaterminacion integer NOT NULL,
    iddecisionterminacion integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioncausadecisionterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 658 (class 1259 OID 88218)
-- Dependencies: 11
-- Name: relacioncausadecisionterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncausadecisionterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcausaterminacion integer NOT NULL,
    idsolicitudterminacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacioncausadecisionterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 659 (class 1259 OID 88221)
-- Dependencies: 11
-- Name: relacioncausaterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncausaterminacionprocesopostulado (
    idcausaterminacion integer NOT NULL,
    idsolicitudterminacion integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioncausaterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 660 (class 1259 OID 88224)
-- Dependencies: 11
-- Name: relacioncausaterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncausaterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcausaterminacion integer,
    idsolicitudterminacion integer,
    usuario character varying(10)
);


ALTER TABLE public.relacioncausaterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 661 (class 1259 OID 88227)
-- Dependencies: 11
-- Name: relacioncompulsacionhistoricoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncompulsacionhistoricoprocesal (
    idcompulsacion bigint NOT NULL,
    idhistoricoprocesal bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioncompulsacionhistoricoprocesal OWNER TO postgres;

--
-- TOC entry 10279 (class 0 OID 0)
-- Dependencies: 661
-- Name: COLUMN relacioncompulsacionhistoricoprocesal.idcompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncompulsacionhistoricoprocesal.idcompulsacion IS 'Identificador de la compulsacion.';


--
-- TOC entry 10280 (class 0 OID 0)
-- Dependencies: 661
-- Name: COLUMN relacioncompulsacionhistoricoprocesal.idhistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncompulsacionhistoricoprocesal.idhistoricoprocesal IS 'Identificador del historico procesal.';


--
-- TOC entry 10281 (class 0 OID 0)
-- Dependencies: 661
-- Name: COLUMN relacioncompulsacionhistoricoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacioncompulsacionhistoricoprocesal.usuario IS 'Identificador del usuario que creo la relacion.';


--
-- TOC entry 662 (class 1259 OID 88230)
-- Dependencies: 11
-- Name: relacioncompulsacionhistoricoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioncompulsacionhistoricoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idcompulsacion bigint,
    idhistoricoprocesal bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacioncompulsacionhistoricoprocesal_audit OWNER TO postgres;

--
-- TOC entry 663 (class 1259 OID 88233)
-- Dependencies: 11
-- Name: relaciondespacho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondespacho (
    iddespachopadre bigint NOT NULL,
    iddespachohijo bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relaciondespacho OWNER TO postgres;

--
-- TOC entry 10282 (class 0 OID 0)
-- Dependencies: 663
-- Name: TABLE relaciondespacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relaciondespacho IS 'Relaciona los despacho con sus padres.';


--
-- TOC entry 10283 (class 0 OID 0)
-- Dependencies: 663
-- Name: COLUMN relaciondespacho.iddespachopadre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relaciondespacho.iddespachopadre IS 'Despacho padre.';


--
-- TOC entry 10284 (class 0 OID 0)
-- Dependencies: 663
-- Name: COLUMN relaciondespacho.iddespachohijo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relaciondespacho.iddespachohijo IS 'Despacho hijo.';


--
-- TOC entry 10285 (class 0 OID 0)
-- Dependencies: 663
-- Name: COLUMN relaciondespacho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relaciondespacho.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 664 (class 1259 OID 88236)
-- Dependencies: 11
-- Name: relaciondespacho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondespacho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddespachopadre bigint,
    iddespachohijo bigint,
    usuario character varying(10)
);


ALTER TABLE public.relaciondespacho_audit OWNER TO postgres;

--
-- TOC entry 665 (class 1259 OID 88239)
-- Dependencies: 11
-- Name: relaciondocumentoedictopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondocumentoedictopostulado (
    radicado character varying(21) NOT NULL,
    iddocumentoedictoemplazatorio integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relaciondocumentoedictopostulado OWNER TO postgres;

--
-- TOC entry 666 (class 1259 OID 88242)
-- Dependencies: 11
-- Name: relaciondocumentoedictopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondocumentoedictopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    iddocumentoedictoemplazatorio integer,
    usuario character varying(10)
);


ALTER TABLE public.relaciondocumentoedictopostulado_audit OWNER TO postgres;

--
-- TOC entry 667 (class 1259 OID 88245)
-- Dependencies: 11
-- Name: relaciondocumentospostulacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondocumentospostulacion (
    iddocumentospostulacion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relaciondocumentospostulacion OWNER TO postgres;

--
-- TOC entry 668 (class 1259 OID 88248)
-- Dependencies: 11
-- Name: relaciondocumentospostulacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciondocumentospostulacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentospostulacion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relaciondocumentospostulacion_audit OWNER TO postgres;

--
-- TOC entry 669 (class 1259 OID 88251)
-- Dependencies: 11
-- Name: relacionevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionevento (
    idevento1 bigint NOT NULL,
    idevento2 bigint NOT NULL,
    idtiporelacionevento bigint NOT NULL,
    observacion text NOT NULL,
    fecharegistrosistema date NOT NULL,
    usuario character varying(10) NOT NULL,
    idetapaflujofuenteinfo bigint
);


ALTER TABLE public.relacionevento OWNER TO postgres;

--
-- TOC entry 10286 (class 0 OID 0)
-- Dependencies: 669
-- Name: TABLE relacionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionevento IS 'Relacion de un evento';


--
-- TOC entry 10287 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.idevento1; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.idevento1 IS 'Identificador unico del evento padre.';


--
-- TOC entry 10288 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.idevento2; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.idevento2 IS 'Identificador unico de la segunde relacion la tabla evento.';


--
-- TOC entry 10289 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.idtiporelacionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.idtiporelacionevento IS 'Identifcador unico del tipo de relacion del evento.';


--
-- TOC entry 10290 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.observacion IS 'Observaciones de la relacion de eventos';


--
-- TOC entry 10291 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.fecharegistrosistema; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.fecharegistrosistema IS 'Fecha de registro de la relacion del evento';


--
-- TOC entry 10292 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 10293 (class 0 OID 0)
-- Dependencies: 669
-- Name: COLUMN relacionevento.idetapaflujofuenteinfo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionevento.idetapaflujofuenteinfo IS 'Identifcador unico de las etapas del flujo de informacion de una fuente de informacion';


--
-- TOC entry 670 (class 1259 OID 88257)
-- Dependencies: 11
-- Name: relacionevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento1 bigint,
    idevento2 bigint,
    idtiporelacionevento bigint,
    observacion text,
    fecharegistrosistema date,
    usuario character varying(10),
    idetapaflujofuenteinfo bigint
);


ALTER TABLE public.relacionevento_audit OWNER TO postgres;

--
-- TOC entry 671 (class 1259 OID 88264)
-- Dependencies: 11
-- Name: relacioneventofuenteinfo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioneventofuenteinfo (
    idevento bigint NOT NULL,
    idfuenteinformacion bigint NOT NULL,
    fechasistema date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioneventofuenteinfo OWNER TO postgres;

--
-- TOC entry 672 (class 1259 OID 88270)
-- Dependencies: 11
-- Name: relacioneventofuenteinfo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioneventofuenteinfo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento bigint NOT NULL,
    idfuenteinformacion bigint NOT NULL,
    fechasistema date,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioneventofuenteinfo_audit OWNER TO postgres;

--
-- TOC entry 673 (class 1259 OID 88273)
-- Dependencies: 11
-- Name: relacioneventomodusoperandi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioneventomodusoperandi (
    idevento bigint NOT NULL,
    idmodusoperandi bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacioneventomodusoperandi OWNER TO postgres;

--
-- TOC entry 674 (class 1259 OID 88276)
-- Dependencies: 11
-- Name: relacioneventomodusoperandi_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacioneventomodusoperandi_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento bigint,
    idmodusoperandi bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacioneventomodusoperandi_audit OWNER TO postgres;

SET default_with_oids = true;

--
-- TOC entry 675 (class 1259 OID 88279)
-- Dependencies: 11
-- Name: relacionfiscaldespachoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfiscaldespachoversion (
    idversion integer NOT NULL,
    fiscal character varying(10) NOT NULL,
    despacho bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionfiscaldespachoversion OWNER TO postgres;

--
-- TOC entry 10294 (class 0 OID 0)
-- Dependencies: 675
-- Name: COLUMN relacionfiscaldespachoversion.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfiscaldespachoversion.idversion IS 'Identificador del evento.';


--
-- TOC entry 10295 (class 0 OID 0)
-- Dependencies: 675
-- Name: COLUMN relacionfiscaldespachoversion.fiscal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfiscaldespachoversion.fiscal IS 'Fiscal (Usuario) que realiza la version de Justicia y Paz.';


--
-- TOC entry 10296 (class 0 OID 0)
-- Dependencies: 675
-- Name: COLUMN relacionfiscaldespachoversion.despacho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfiscaldespachoversion.despacho IS 'Despacho que realiza la version libre de justicia y paz.';


--
-- TOC entry 10297 (class 0 OID 0)
-- Dependencies: 675
-- Name: COLUMN relacionfiscaldespachoversion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfiscaldespachoversion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 676 (class 1259 OID 88282)
-- Dependencies: 11
-- Name: relacionfiscaldespachoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfiscaldespachoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idversion integer,
    fiscal character varying(10),
    despacho integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionfiscaldespachoversion_audit OWNER TO postgres;

SET default_with_oids = false;

--
-- TOC entry 677 (class 1259 OID 88285)
-- Dependencies: 11
-- Name: relacionfuentehistorialpga; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuentehistorialpga (
    idfuenteinformacion integer NOT NULL,
    idhistorial integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuentehistorialpga OWNER TO postgres;

--
-- TOC entry 10298 (class 0 OID 0)
-- Dependencies: 677
-- Name: TABLE relacionfuentehistorialpga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuentehistorialpga IS 'Tabla de relacion de historiales de personas con fuentes de informacion.';


--
-- TOC entry 10299 (class 0 OID 0)
-- Dependencies: 677
-- Name: COLUMN relacionfuentehistorialpga.idfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentehistorialpga.idfuenteinformacion IS 'Identificador unico de la fuente de informacion para la relacion.';


--
-- TOC entry 10300 (class 0 OID 0)
-- Dependencies: 677
-- Name: COLUMN relacionfuentehistorialpga.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentehistorialpga.idhistorial IS 'Identificador unicodel historial de la persona en el grupo armado para la relacion.';


--
-- TOC entry 10301 (class 0 OID 0)
-- Dependencies: 677
-- Name: COLUMN relacionfuentehistorialpga.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentehistorialpga.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 678 (class 1259 OID 88288)
-- Dependencies: 11
-- Name: relacionfuentehistorialpga_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuentehistorialpga_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfuenteinformacion integer,
    idhistorial integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuentehistorialpga_audit OWNER TO postgres;

--
-- TOC entry 10302 (class 0 OID 0)
-- Dependencies: 678
-- Name: TABLE relacionfuentehistorialpga_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuentehistorialpga_audit IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 10303 (class 0 OID 0)
-- Dependencies: 678
-- Name: COLUMN relacionfuentehistorialpga_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentehistorialpga_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 10304 (class 0 OID 0)
-- Dependencies: 678
-- Name: COLUMN relacionfuentehistorialpga_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentehistorialpga_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 679 (class 1259 OID 88291)
-- Dependencies: 11
-- Name: relacionfuentepersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuentepersona (
    idfuente bigint NOT NULL,
    idevento bigint NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuentepersona OWNER TO postgres;

--
-- TOC entry 10305 (class 0 OID 0)
-- Dependencies: 679
-- Name: TABLE relacionfuentepersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuentepersona IS 'Tabla de la Relacion fuente persona';


--
-- TOC entry 10306 (class 0 OID 0)
-- Dependencies: 679
-- Name: COLUMN relacionfuentepersona.idfuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona.idfuente IS 'Identificador unico de la fuente';


--
-- TOC entry 10307 (class 0 OID 0)
-- Dependencies: 679
-- Name: COLUMN relacionfuentepersona.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10308 (class 0 OID 0)
-- Dependencies: 679
-- Name: COLUMN relacionfuentepersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 680 (class 1259 OID 88294)
-- Dependencies: 11
-- Name: relacionfuentepersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuentepersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idfuente bigint NOT NULL,
    idevento bigint NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuentepersona_audit OWNER TO postgres;

--
-- TOC entry 10309 (class 0 OID 0)
-- Dependencies: 680
-- Name: TABLE relacionfuentepersona_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuentepersona_audit IS 'Relacion fuente persona';


--
-- TOC entry 10310 (class 0 OID 0)
-- Dependencies: 680
-- Name: COLUMN relacionfuentepersona_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10311 (class 0 OID 0)
-- Dependencies: 680
-- Name: COLUMN relacionfuentepersona_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona_audit.fechaactualizacion IS 'Fecha en la que se realiza la actualizacion';


--
-- TOC entry 10312 (class 0 OID 0)
-- Dependencies: 680
-- Name: COLUMN relacionfuentepersona_audit.idfuente; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona_audit.idfuente IS 'Identificador unico de la fuente';


--
-- TOC entry 10313 (class 0 OID 0)
-- Dependencies: 680
-- Name: COLUMN relacionfuentepersona_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona_audit.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10314 (class 0 OID 0)
-- Dependencies: 680
-- Name: COLUMN relacionfuentepersona_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuentepersona_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 681 (class 1259 OID 88297)
-- Dependencies: 11
-- Name: relacionfuncionperfil; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuncionperfil (
    idperfil numeric(10,0) NOT NULL,
    idfuncion numeric(10,0) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuncionperfil OWNER TO postgres;

--
-- TOC entry 10315 (class 0 OID 0)
-- Dependencies: 681
-- Name: TABLE relacionfuncionperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuncionperfil IS 'Tabla de la relacion funcion perfil';


--
-- TOC entry 10316 (class 0 OID 0)
-- Dependencies: 681
-- Name: COLUMN relacionfuncionperfil.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil.idperfil IS 'Identificador unico del perfil';


--
-- TOC entry 10317 (class 0 OID 0)
-- Dependencies: 681
-- Name: COLUMN relacionfuncionperfil.idfuncion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil.idfuncion IS 'Identificador unico de la funcion';


--
-- TOC entry 10318 (class 0 OID 0)
-- Dependencies: 681
-- Name: COLUMN relacionfuncionperfil.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 682 (class 1259 OID 88300)
-- Dependencies: 11
-- Name: relacionfuncionperfil_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionfuncionperfil_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idperfil numeric(10,0) NOT NULL,
    idfuncion numeric(10,0) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionfuncionperfil_audit OWNER TO postgres;

--
-- TOC entry 10319 (class 0 OID 0)
-- Dependencies: 682
-- Name: TABLE relacionfuncionperfil_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionfuncionperfil_audit IS 'Relacion funcion perfil';


--
-- TOC entry 10320 (class 0 OID 0)
-- Dependencies: 682
-- Name: COLUMN relacionfuncionperfil_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10321 (class 0 OID 0)
-- Dependencies: 682
-- Name: COLUMN relacionfuncionperfil_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil_audit.fechaactualizacion IS 'Fecha de actualizacion';


--
-- TOC entry 10322 (class 0 OID 0)
-- Dependencies: 682
-- Name: COLUMN relacionfuncionperfil_audit.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil_audit.idperfil IS 'Identificador unico del perfil';


--
-- TOC entry 10323 (class 0 OID 0)
-- Dependencies: 682
-- Name: COLUMN relacionfuncionperfil_audit.idfuncion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil_audit.idfuncion IS 'Identificador unico de la funcion';


--
-- TOC entry 10324 (class 0 OID 0)
-- Dependencies: 682
-- Name: COLUMN relacionfuncionperfil_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionfuncionperfil_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 683 (class 1259 OID 88303)
-- Dependencies: 11
-- Name: relaciongenesisgrupoarmadofuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongenesisgrupoarmadofuenteinformacion (
    idgenesisgrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongenesisgrupoarmadofuenteinformacion OWNER TO postgres;

--
-- TOC entry 684 (class 1259 OID 88306)
-- Dependencies: 11
-- Name: relaciongenesisgrupoarmadofuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongenesisgrupoarmadofuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgenesisgrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongenesisgrupoarmadofuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 685 (class 1259 OID 88309)
-- Dependencies: 11
-- Name: relaciongenesisgrupoarmadoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongenesisgrupoarmadoversion (
    idgenesisgrupoarmado integer NOT NULL,
    idversion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongenesisgrupoarmadoversion OWNER TO postgres;

--
-- TOC entry 686 (class 1259 OID 88312)
-- Dependencies: 11
-- Name: relaciongenesisgrupoarmadoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongenesisgrupoarmadoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgenesisgrupoarmado integer,
    idversion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relaciongenesisgrupoarmadoversion_audit OWNER TO postgres;

--
-- TOC entry 687 (class 1259 OID 88315)
-- Dependencies: 11
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongeoreferenciaciongrupoarmadofuenteinformacion (
    idgeoreferenciaciongrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongeoreferenciaciongrupoarmadofuenteinformacion OWNER TO postgres;

--
-- TOC entry 688 (class 1259 OID 88318)
-- Dependencies: 11
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgeoreferenciaciongrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 689 (class 1259 OID 88321)
-- Dependencies: 11
-- Name: relaciongeoreferenciaciongrupoarmadoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongeoreferenciaciongrupoarmadoversion (
    idgeoreferenciaciongrupoarmado integer NOT NULL,
    idversion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relaciongeoreferenciaciongrupoarmadoversion OWNER TO postgres;

--
-- TOC entry 690 (class 1259 OID 88324)
-- Dependencies: 11
-- Name: relaciongeoreferenciaciongrupoarmadoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relaciongeoreferenciaciongrupoarmadoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idgeoreferenciaciongrupoarmado integer,
    idversion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relaciongeoreferenciaciongrupoarmadoversion_audit OWNER TO postgres;

--
-- TOC entry 691 (class 1259 OID 88327)
-- Dependencies: 11
-- Name: relacionhistoricoprocesalfuenteinfo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionhistoricoprocesalfuenteinfo (
    idhistoricoprocesal bigint NOT NULL,
    idfuenteinformacion bigint NOT NULL,
    fechasistema date NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionhistoricoprocesalfuenteinfo OWNER TO postgres;

--
-- TOC entry 692 (class 1259 OID 88330)
-- Dependencies: 11
-- Name: relacionhistoricoprocesalfuenteinfo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionhistoricoprocesalfuenteinfo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idhistoricoprocesal bigint NOT NULL,
    idfuenteinformacion bigint NOT NULL,
    fechasistema date,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionhistoricoprocesalfuenteinfo_audit OWNER TO postgres;

--
-- TOC entry 693 (class 1259 OID 88333)
-- Dependencies: 11
-- Name: relacionidentificaciongrupoarmadofuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionidentificaciongrupoarmadofuenteinformacion (
    ididentificaciongrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionidentificaciongrupoarmadofuenteinformacion OWNER TO postgres;

--
-- TOC entry 694 (class 1259 OID 88336)
-- Dependencies: 11
-- Name: relacionidentificaciongrupoarmadofuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionidentificaciongrupoarmadofuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    ididentificaciongrupoarmado integer NOT NULL,
    idfuenteinformacion integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionidentificaciongrupoarmadofuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 695 (class 1259 OID 88339)
-- Dependencies: 11
-- Name: relacionidentificaciongrupoarmadoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionidentificaciongrupoarmadoversion (
    ididentificaciongrupoarmado integer NOT NULL,
    idversion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionidentificaciongrupoarmadoversion OWNER TO postgres;

--
-- TOC entry 696 (class 1259 OID 88342)
-- Dependencies: 11
-- Name: relacionidentificaciongrupoarmadoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionidentificaciongrupoarmadoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    ididentificaciongrupoarmado integer,
    idversion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relacionidentificaciongrupoarmadoversion_audit OWNER TO postgres;

--
-- TOC entry 697 (class 1259 OID 88345)
-- Dependencies: 11
-- Name: relacionmagistradoaudiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionmagistradoaudiencia (
    idaudiencia integer NOT NULL,
    idmagistrado integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionmagistradoaudiencia OWNER TO postgres;

--
-- TOC entry 698 (class 1259 OID 88348)
-- Dependencies: 11
-- Name: relacionmagistradoaudiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionmagistradoaudiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idaudiencia integer,
    idmagistrado integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionmagistradoaudiencia_audit OWNER TO postgres;

--
-- TOC entry 699 (class 1259 OID 88351)
-- Dependencies: 11
-- Name: relacionnotificacioncorreopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionnotificacioncorreopostulado (
    radicado character varying(21) NOT NULL,
    idnotificacioncorreo integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionnotificacioncorreopostulado OWNER TO postgres;

--
-- TOC entry 10325 (class 0 OID 0)
-- Dependencies: 699
-- Name: COLUMN relacionnotificacioncorreopostulado.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionnotificacioncorreopostulado.radicado IS 'Radicado.';


--
-- TOC entry 10326 (class 0 OID 0)
-- Dependencies: 699
-- Name: COLUMN relacionnotificacioncorreopostulado.idnotificacioncorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionnotificacioncorreopostulado.idnotificacioncorreo IS 'Identificador para la notificacion.';


--
-- TOC entry 10327 (class 0 OID 0)
-- Dependencies: 699
-- Name: COLUMN relacionnotificacioncorreopostulado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionnotificacioncorreopostulado.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 700 (class 1259 OID 88354)
-- Dependencies: 11
-- Name: relacionnotificacioncorreopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionnotificacioncorreopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    idnotificacioncorreo integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionnotificacioncorreopostulado_audit OWNER TO postgres;

--
-- TOC entry 701 (class 1259 OID 88357)
-- Dependencies: 11
-- Name: relacionperfilreporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionperfilreporte (
    idperfil integer NOT NULL,
    idreporte integer NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.relacionperfilreporte OWNER TO postgres;

--
-- TOC entry 702 (class 1259 OID 88360)
-- Dependencies: 11
-- Name: relacionperfilreporte_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionperfilreporte_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idperfil integer,
    idreporte integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionperfilreporte_audit OWNER TO postgres;

--
-- TOC entry 703 (class 1259 OID 88363)
-- Dependencies: 11
-- Name: relacionpersonacompulsacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonacompulsacion (
    idpersona bigint NOT NULL,
    idcompulsacion bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpersonacompulsacion OWNER TO postgres;

--
-- TOC entry 10328 (class 0 OID 0)
-- Dependencies: 703
-- Name: COLUMN relacionpersonacompulsacion.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonacompulsacion.idpersona IS 'Identificador de la persona.';


--
-- TOC entry 10329 (class 0 OID 0)
-- Dependencies: 703
-- Name: COLUMN relacionpersonacompulsacion.idcompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonacompulsacion.idcompulsacion IS 'Identificador de la compulsacion.';


--
-- TOC entry 10330 (class 0 OID 0)
-- Dependencies: 703
-- Name: COLUMN relacionpersonacompulsacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonacompulsacion.usuario IS 'Identificador del usuario que creo la relacion.';


--
-- TOC entry 704 (class 1259 OID 88366)
-- Dependencies: 11
-- Name: relacionpersonacompulsacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonacompulsacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersona bigint,
    idcompulsacion bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacionpersonacompulsacion_audit OWNER TO postgres;

--
-- TOC entry 705 (class 1259 OID 88369)
-- Dependencies: 332 11
-- Name: relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq OWNER TO postgres;

--
-- TOC entry 10331 (class 0 OID 0)
-- Dependencies: 705
-- Name: relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq OWNED BY relacionpersonajuridicacolectividad.idrelacionpersonajuridicacolectividad;


--
-- TOC entry 706 (class 1259 OID 88371)
-- Dependencies: 11
-- Name: relacionpersonajuridicacolectividad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonajuridicacolectividad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idrelacionpersonajuridicacolectividad integer,
    idpersonajuridicacolectividad integer,
    idpersonanatural integer,
    cargo character varying(50),
    idtiporelacionpersonajuridicacolectividad integer,
    idtipodocumentopersona integer,
    numerodocumento character varying(20),
    fechaexpedicion date,
    idpaisexpedicion integer,
    iddepartamentoexpedicion integer,
    idmunicipioexpedicion integer,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.relacionpersonajuridicacolectividad_audit OWNER TO postgres;

--
-- TOC entry 707 (class 1259 OID 88374)
-- Dependencies: 11
-- Name: relacionpersonaparentesco; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonaparentesco (
    idpersonaprincipal bigint NOT NULL,
    idpersonasecundaria bigint NOT NULL,
    idtiporelacionparentesco bigint NOT NULL,
    usuario character varying(10),
    observacion text,
    fecharegistrosistema date,
    dependenciaeconomica boolean,
    vivenjuntos boolean,
    ip character varying(15)
);


ALTER TABLE public.relacionpersonaparentesco OWNER TO postgres;

--
-- TOC entry 10332 (class 0 OID 0)
-- Dependencies: 707
-- Name: TABLE relacionpersonaparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionpersonaparentesco IS 'Tabla de la relacion persona parentesco';


--
-- TOC entry 10333 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.idpersonaprincipal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.idpersonaprincipal IS 'Identificador unico de la persona principal';


--
-- TOC entry 10334 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.idpersonasecundaria; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.idpersonasecundaria IS 'Identificador unico de la persona secundaria';


--
-- TOC entry 10335 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.idtiporelacionparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.idtiporelacionparentesco IS 'Identificador unico de la relacion de parentesco';


--
-- TOC entry 10336 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10337 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.dependenciaeconomica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.dependenciaeconomica IS 'Dependencia economica.';


--
-- TOC entry 10338 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.vivenjuntos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.vivenjuntos IS 'Viven juntos.';


--
-- TOC entry 10339 (class 0 OID 0)
-- Dependencies: 707
-- Name: COLUMN relacionpersonaparentesco.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco.ip IS 'Ip de ultima accion.';


--
-- TOC entry 708 (class 1259 OID 88380)
-- Dependencies: 11
-- Name: relacionpersonaparentesco_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpersonaparentesco_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersonaprincipal bigint NOT NULL,
    idpersonasecundaria bigint NOT NULL,
    idtiporelacionparentesco bigint NOT NULL,
    usuario character varying(10),
    observacion text,
    fecharegistrosistema date,
    dependenciaeconomica boolean,
    vivenjuntos boolean,
    ip character varying(15)
);


ALTER TABLE public.relacionpersonaparentesco_audit OWNER TO postgres;

--
-- TOC entry 10340 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10341 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.fechaactualizacion IS 'Fecha de la actualizacion';


--
-- TOC entry 10342 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.idpersonaprincipal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.idpersonaprincipal IS 'Identificador unico de la persona principal';


--
-- TOC entry 10343 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.idpersonasecundaria; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.idpersonasecundaria IS 'Identificador unico de la persona secundaria';


--
-- TOC entry 10344 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.idtiporelacionparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.idtiporelacionparentesco IS 'Identificador unico de la relacion de parentesco';


--
-- TOC entry 10345 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10346 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.dependenciaeconomica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.dependenciaeconomica IS 'Dependencia economica.';


--
-- TOC entry 10347 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.vivenjuntos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.vivenjuntos IS 'Viven juntos.';


--
-- TOC entry 10348 (class 0 OID 0)
-- Dependencies: 708
-- Name: COLUMN relacionpersonaparentesco_audit.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpersonaparentesco_audit.ip IS 'Ip de ultima accion.';


--
-- TOC entry 709 (class 1259 OID 88386)
-- Dependencies: 11
-- Name: relacionpostuladoacta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladoacta (
    radicado character varying(21) NOT NULL,
    idacta integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpostuladoacta OWNER TO postgres;

--
-- TOC entry 10349 (class 0 OID 0)
-- Dependencies: 709
-- Name: COLUMN relacionpostuladoacta.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoacta.radicado IS 'Identifcador unico para la relacion postulado actas y su radicado.';


--
-- TOC entry 10350 (class 0 OID 0)
-- Dependencies: 709
-- Name: COLUMN relacionpostuladoacta.idacta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoacta.idacta IS 'Identifcador unico para la relacion de las actas.';


--
-- TOC entry 10351 (class 0 OID 0)
-- Dependencies: 709
-- Name: COLUMN relacionpostuladoacta.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoacta.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 710 (class 1259 OID 88389)
-- Dependencies: 11
-- Name: relacionpostuladoacta_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladoacta_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    idacta integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionpostuladoacta_audit OWNER TO postgres;

--
-- TOC entry 711 (class 1259 OID 88392)
-- Dependencies: 11
-- Name: relacionpostuladodocumentopostulacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladodocumentopostulacion (
    iddocumentopostulacion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpostuladodocumentopostulacion OWNER TO postgres;

--
-- TOC entry 10352 (class 0 OID 0)
-- Dependencies: 711
-- Name: COLUMN relacionpostuladodocumentopostulacion.iddocumentopostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladodocumentopostulacion.iddocumentopostulacion IS 'Identificador unico para el documento de postulacion.';


--
-- TOC entry 10353 (class 0 OID 0)
-- Dependencies: 711
-- Name: COLUMN relacionpostuladodocumentopostulacion.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladodocumentopostulacion.radicado IS 'Radicado.';


--
-- TOC entry 10354 (class 0 OID 0)
-- Dependencies: 711
-- Name: COLUMN relacionpostuladodocumentopostulacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladodocumentopostulacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 712 (class 1259 OID 88395)
-- Dependencies: 11
-- Name: relacionpostuladodocumentopostulacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladodocumentopostulacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddocumentopostulacion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relacionpostuladodocumentopostulacion_audit OWNER TO postgres;

SET default_with_oids = true;

--
-- TOC entry 713 (class 1259 OID 88398)
-- Dependencies: 11
-- Name: relacionpostuladoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladoversion (
    idversion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpostuladoversion OWNER TO postgres;

--
-- TOC entry 10355 (class 0 OID 0)
-- Dependencies: 713
-- Name: COLUMN relacionpostuladoversion.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoversion.idversion IS 'Identificador del evento.';


--
-- TOC entry 10356 (class 0 OID 0)
-- Dependencies: 713
-- Name: COLUMN relacionpostuladoversion.radicado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoversion.radicado IS 'Identificador de la version.';


--
-- TOC entry 10357 (class 0 OID 0)
-- Dependencies: 713
-- Name: COLUMN relacionpostuladoversion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionpostuladoversion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 714 (class 1259 OID 88401)
-- Dependencies: 11
-- Name: relacionpostuladoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpostuladoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idversion integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relacionpostuladoversion_audit OWNER TO postgres;

SET default_with_oids = false;

--
-- TOC entry 715 (class 1259 OID 88404)
-- Dependencies: 11
-- Name: relacionpublicacionexternapostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpublicacionexternapostulado (
    idpublicacionexterna integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpublicacionexternapostulado OWNER TO postgres;

--
-- TOC entry 716 (class 1259 OID 88407)
-- Dependencies: 11
-- Name: relacionpublicacionexternapostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpublicacionexternapostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpublicacionexterna integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relacionpublicacionexternapostulado_audit OWNER TO postgres;

--
-- TOC entry 717 (class 1259 OID 88410)
-- Dependencies: 11
-- Name: relacionpublicacioninternapostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpublicacioninternapostulado (
    idpublicacioninterna integer NOT NULL,
    radicado character varying(21) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionpublicacioninternapostulado OWNER TO postgres;

--
-- TOC entry 718 (class 1259 OID 88413)
-- Dependencies: 11
-- Name: relacionpublicacioninternapostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionpublicacioninternapostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpublicacioninterna integer,
    radicado character varying(21),
    usuario character varying(10)
);


ALTER TABLE public.relacionpublicacioninternapostulado_audit OWNER TO postgres;

--
-- TOC entry 719 (class 1259 OID 88416)
-- Dependencies: 11
-- Name: relacionregistrohechodocumento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionregistrohechodocumento (
    idregistrohecho bigint NOT NULL,
    iddocumento bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.relacionregistrohechodocumento OWNER TO postgres;

--
-- TOC entry 10358 (class 0 OID 0)
-- Dependencies: 719
-- Name: TABLE relacionregistrohechodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionregistrohechodocumento IS 'Relacion entre un Registro de un hecho y un Documento.';


--
-- TOC entry 10359 (class 0 OID 0)
-- Dependencies: 719
-- Name: COLUMN relacionregistrohechodocumento.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento.idregistrohecho IS 'Identificador unico del Registro del hecho.';


--
-- TOC entry 10360 (class 0 OID 0)
-- Dependencies: 719
-- Name: COLUMN relacionregistrohechodocumento.iddocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento.iddocumento IS 'Identificador unico de un documento.';


--
-- TOC entry 10361 (class 0 OID 0)
-- Dependencies: 719
-- Name: COLUMN relacionregistrohechodocumento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento.usuario IS 'Ultimo usuario que actualizo el registro.';


--
-- TOC entry 720 (class 1259 OID 88419)
-- Dependencies: 11
-- Name: relacionregistrohechodocumento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionregistrohechodocumento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idregistrohecho bigint,
    iddocumento bigint,
    usuario character varying(10)
);


ALTER TABLE public.relacionregistrohechodocumento_audit OWNER TO postgres;

--
-- TOC entry 10362 (class 0 OID 0)
-- Dependencies: 720
-- Name: COLUMN relacionregistrohechodocumento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10363 (class 0 OID 0)
-- Dependencies: 720
-- Name: COLUMN relacionregistrohechodocumento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento_audit.fechaactualizacion IS 'Fecha de la actualizacion';


--
-- TOC entry 10364 (class 0 OID 0)
-- Dependencies: 720
-- Name: COLUMN relacionregistrohechodocumento_audit.idregistrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento_audit.idregistrohecho IS 'Identificador unico del Registro del hecho';


--
-- TOC entry 10365 (class 0 OID 0)
-- Dependencies: 720
-- Name: COLUMN relacionregistrohechodocumento_audit.iddocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento_audit.iddocumento IS 'Identificador unico de un documento';


--
-- TOC entry 10366 (class 0 OID 0)
-- Dependencies: 720
-- Name: COLUMN relacionregistrohechodocumento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionregistrohechodocumento_audit.usuario IS 'Ultimo usuario que actualizo el registro';


--
-- TOC entry 721 (class 1259 OID 88422)
-- Dependencies: 11
-- Name: relacionreporteprogramacionreporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionreporteprogramacionreporte (
    idprogramacionreporte integer NOT NULL,
    idreporte integer NOT NULL,
    idestadoprogramacionreporte integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionreporteprogramacionreporte OWNER TO postgres;

--
-- TOC entry 722 (class 1259 OID 88425)
-- Dependencies: 11
-- Name: relacionreporteprogramacionreporte_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionreporteprogramacionreporte_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idprogramacionreporte integer,
    idreporte integer,
    usuario character varying(10)
);


ALTER TABLE public.relacionreporteprogramacionreporte_audit OWNER TO postgres;

--
-- TOC entry 723 (class 1259 OID 88428)
-- Dependencies: 11
-- Name: relacionsenalregion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionsenalregion (
    idsenal bigint NOT NULL,
    idregion bigint NOT NULL,
    idpersona bigint NOT NULL,
    descripcion text,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.relacionsenalregion OWNER TO postgres;

--
-- TOC entry 10367 (class 0 OID 0)
-- Dependencies: 723
-- Name: TABLE relacionsenalregion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionsenalregion IS 'Tabla de la relacion senal con un evento';


--
-- TOC entry 10368 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.idsenal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.idsenal IS 'Identificador unico de la senal';


--
-- TOC entry 10369 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.idregion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.idregion IS 'Identificador unico de la region';


--
-- TOC entry 10370 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10371 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.descripcion IS 'Descripcion de la senal';


--
-- TOC entry 10372 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10373 (class 0 OID 0)
-- Dependencies: 723
-- Name: COLUMN relacionsenalregion.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion.ip IS 'Ip de ultima accion.';


--
-- TOC entry 724 (class 1259 OID 88434)
-- Dependencies: 11
-- Name: relacionsenalregion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionsenalregion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idsenal bigint NOT NULL,
    idregion bigint NOT NULL,
    idpersona bigint NOT NULL,
    descripcion text,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.relacionsenalregion_audit OWNER TO postgres;

--
-- TOC entry 10374 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10375 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.fechaactualizacion IS 'Fecha de la actualizacion';


--
-- TOC entry 10376 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.idsenal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.idsenal IS 'Identificador unico de la senal';


--
-- TOC entry 10377 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.idregion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.idregion IS 'Identificador unico de la region';


--
-- TOC entry 10378 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10379 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.descripcion IS 'Descripcion de la senal';


--
-- TOC entry 10380 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10381 (class 0 OID 0)
-- Dependencies: 724
-- Name: COLUMN relacionsenalregion_audit.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionsenalregion_audit.ip IS 'Ip de ultima accion.';


--
-- TOC entry 725 (class 1259 OID 88440)
-- Dependencies: 11
-- Name: relacionversionevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionversionevento (
    idevento bigint NOT NULL,
    idversion bigint NOT NULL,
    hora character varying(5) NOT NULL,
    idtipohechoversion bigint NOT NULL,
    usuario character varying(10) NOT NULL,
    radicado character varying(21)
);


ALTER TABLE public.relacionversionevento OWNER TO postgres;

--
-- TOC entry 10382 (class 0 OID 0)
-- Dependencies: 725
-- Name: TABLE relacionversionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionversionevento IS 'Relacion de la vesion con un evento.';


--
-- TOC entry 10383 (class 0 OID 0)
-- Dependencies: 725
-- Name: COLUMN relacionversionevento.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento.idevento IS 'Identificador del evento.';


--
-- TOC entry 10384 (class 0 OID 0)
-- Dependencies: 725
-- Name: COLUMN relacionversionevento.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento.idversion IS 'Identificador de la version.';


--
-- TOC entry 10385 (class 0 OID 0)
-- Dependencies: 725
-- Name: COLUMN relacionversionevento.hora; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento.hora IS 'Hora en la que se describe el hecho.';


--
-- TOC entry 10386 (class 0 OID 0)
-- Dependencies: 725
-- Name: COLUMN relacionversionevento.idtipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento.idtipohechoversion IS 'Identificador del tipo de hecho de la version.';


--
-- TOC entry 10387 (class 0 OID 0)
-- Dependencies: 725
-- Name: COLUMN relacionversionevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 726 (class 1259 OID 88443)
-- Dependencies: 11
-- Name: relacionversionevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionversionevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idevento bigint,
    idversion bigint,
    hora character varying(5),
    idtipohechoversion bigint,
    usuario character varying(10),
    radicado character varying(21)
);


ALTER TABLE public.relacionversionevento_audit OWNER TO postgres;

--
-- TOC entry 10388 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10389 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.fechaactualizacion IS 'Fecha de actualizacion de la relacion version evento';


--
-- TOC entry 10390 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.idevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.idevento IS 'Identificador unico del evento';


--
-- TOC entry 10391 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.idversion IS 'Identificador unico de la version';


--
-- TOC entry 10392 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.hora; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.hora IS 'Hora en la que se describe el hecho';


--
-- TOC entry 10393 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.idtipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.idtipohechoversion IS 'Identificador unico del tipo de hecho de la version';


--
-- TOC entry 10394 (class 0 OID 0)
-- Dependencies: 726
-- Name: COLUMN relacionversionevento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionevento_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 727 (class 1259 OID 88446)
-- Dependencies: 11
-- Name: relacionversionhistorialpga; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionversionhistorialpga (
    idversion integer NOT NULL,
    idhistorial integer NOT NULL,
    usuario character varying(10),
    radicado character varying(21)
);


ALTER TABLE public.relacionversionhistorialpga OWNER TO postgres;

--
-- TOC entry 10395 (class 0 OID 0)
-- Dependencies: 727
-- Name: TABLE relacionversionhistorialpga; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionversionhistorialpga IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 10396 (class 0 OID 0)
-- Dependencies: 727
-- Name: COLUMN relacionversionhistorialpga.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionhistorialpga.idversion IS 'Identificador unico de la version para la relacion.';


--
-- TOC entry 10397 (class 0 OID 0)
-- Dependencies: 727
-- Name: COLUMN relacionversionhistorialpga.idhistorial; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionhistorialpga.idhistorial IS 'Identificador unicodel historial de la persona en el grupo armado para la relacion.';


--
-- TOC entry 10398 (class 0 OID 0)
-- Dependencies: 727
-- Name: COLUMN relacionversionhistorialpga.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionhistorialpga.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 728 (class 1259 OID 88449)
-- Dependencies: 11
-- Name: relacionversionhistorialpga_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionversionhistorialpga_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idversion integer NOT NULL,
    idhistorial integer NOT NULL,
    usuario character varying(10),
    radicado character varying(21)
);


ALTER TABLE public.relacionversionhistorialpga_audit OWNER TO postgres;

--
-- TOC entry 10399 (class 0 OID 0)
-- Dependencies: 728
-- Name: TABLE relacionversionhistorialpga_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionversionhistorialpga_audit IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 10400 (class 0 OID 0)
-- Dependencies: 728
-- Name: COLUMN relacionversionhistorialpga_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionhistorialpga_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 10401 (class 0 OID 0)
-- Dependencies: 728
-- Name: COLUMN relacionversionhistorialpga_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionversionhistorialpga_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 729 (class 1259 OID 88452)
-- Dependencies: 7393 7394 7395 7396 11
-- Name: relacionvictimahecho; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionvictimahecho (
    idvictima bigint NOT NULL,
    idhecho bigint NOT NULL,
    calidadvictima bigint,
    edadfechaevento integer,
    usuario character varying(10),
    idtiporangoedad bigint DEFAULT 0 NOT NULL,
    idtipoedad bigint DEFAULT 0 NOT NULL,
    observacionedad character varying(100) DEFAULT ''::character varying NOT NULL,
    mayordeedad bigint DEFAULT 1 NOT NULL
);


ALTER TABLE public.relacionvictimahecho OWNER TO postgres;

--
-- TOC entry 10402 (class 0 OID 0)
-- Dependencies: 729
-- Name: TABLE relacionvictimahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relacionvictimahecho IS 'Tabla relacion victima hecho';


--
-- TOC entry 10403 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.idvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.idvictima IS 'Identificador unico de la victima';


--
-- TOC entry 10404 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10405 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.calidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.calidadvictima IS 'Calidad de la victima';


--
-- TOC entry 10406 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.edadfechaevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.edadfechaevento IS 'Edad fecha evento';


--
-- TOC entry 10407 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10408 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.idtiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.idtiporangoedad IS 'Identificador unico del tipo de rango de edad';


--
-- TOC entry 10409 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.idtipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.idtipoedad IS 'Identificador unico del tipo de edad';


--
-- TOC entry 10410 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.observacionedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.observacionedad IS 'Observacion edad';


--
-- TOC entry 10411 (class 0 OID 0)
-- Dependencies: 729
-- Name: COLUMN relacionvictimahecho.mayordeedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho.mayordeedad IS 'Mayor de edad';


--
-- TOC entry 730 (class 1259 OID 88459)
-- Dependencies: 11
-- Name: relacionvictimahecho_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relacionvictimahecho_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idvictima bigint NOT NULL,
    idhecho bigint NOT NULL,
    calidadvictima bigint,
    edadfechaevento integer,
    usuario character varying(10),
    idtiporangoedad bigint,
    idtipoedad bigint,
    observacionedad character varying(100),
    mayordeedad bigint
);


ALTER TABLE public.relacionvictimahecho_audit OWNER TO postgres;

--
-- TOC entry 10412 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10413 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.fechaactualizacion IS 'Fecha de actualizacion de la tabla victima hecho';


--
-- TOC entry 10414 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.idvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.idvictima IS 'Identificador unico de la victima';


--
-- TOC entry 10415 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10416 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.calidadvictima; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.calidadvictima IS 'Calidad de la victima';


--
-- TOC entry 10417 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.edadfechaevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.edadfechaevento IS 'Edad fecha evento';


--
-- TOC entry 10418 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 10419 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.idtiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.idtiporangoedad IS 'Identificador unico del tipo de rango de edad';


--
-- TOC entry 10420 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.idtipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.idtipoedad IS 'Identificador unico del tipo de edad';


--
-- TOC entry 10421 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.observacionedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.observacionedad IS 'Observacion edad';


--
-- TOC entry 10422 (class 0 OID 0)
-- Dependencies: 730
-- Name: COLUMN relacionvictimahecho_audit.mayordeedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN relacionvictimahecho_audit.mayordeedad IS 'Mayor de edad';


--
-- TOC entry 731 (class 1259 OID 88462)
-- Dependencies: 11
-- Name: religion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE religion (
    idreligion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.religion OWNER TO postgres;

--
-- TOC entry 10423 (class 0 OID 0)
-- Dependencies: 731
-- Name: TABLE religion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE religion IS 'Nombres de las diferentes religion para identificar a una persona';


--
-- TOC entry 10424 (class 0 OID 0)
-- Dependencies: 731
-- Name: COLUMN religion.idreligion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN religion.idreligion IS 'Identifcador unico de la religion.';


--
-- TOC entry 10425 (class 0 OID 0)
-- Dependencies: 731
-- Name: COLUMN religion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN religion.descripcion IS 'Descripcion de la religion.';


--
-- TOC entry 10426 (class 0 OID 0)
-- Dependencies: 731
-- Name: COLUMN religion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN religion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 732 (class 1259 OID 88465)
-- Dependencies: 11
-- Name: religion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE religion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idreligion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.religion_audit OWNER TO postgres;

--
-- TOC entry 733 (class 1259 OID 88468)
-- Dependencies: 731 11
-- Name: religion_idreligion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE religion_idreligion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.religion_idreligion_seq OWNER TO postgres;

--
-- TOC entry 10427 (class 0 OID 0)
-- Dependencies: 733
-- Name: religion_idreligion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE religion_idreligion_seq OWNED BY religion.idreligion;


--
-- TOC entry 734 (class 1259 OID 88470)
-- Dependencies: 11
-- Name: reporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reporte (
    idreporte integer NOT NULL,
    idformatoreporte integer,
    nombrereporte character varying(100),
    nombreultimogenerado character varying(100),
    usuario character varying(10),
    urlreporte character(100),
    estaactivo boolean
);


ALTER TABLE public.reporte OWNER TO postgres;

--
-- TOC entry 735 (class 1259 OID 88473)
-- Dependencies: 11
-- Name: reporte_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reporte_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idreporte integer NOT NULL,
    idformatoreporte integer,
    nombrereporte character varying(100),
    nombreultimogenerado character varying(100),
    usuario character varying(10),
    urlreporte character(100),
    estaactivo boolean
);


ALTER TABLE public.reporte_audit OWNER TO postgres;

--
-- TOC entry 736 (class 1259 OID 88476)
-- Dependencies: 735 11
-- Name: reporte_audit_idreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reporte_audit_idreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reporte_audit_idreporte_seq OWNER TO postgres;

--
-- TOC entry 10428 (class 0 OID 0)
-- Dependencies: 736
-- Name: reporte_audit_idreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reporte_audit_idreporte_seq OWNED BY reporte_audit.idreporte;


--
-- TOC entry 737 (class 1259 OID 88478)
-- Dependencies: 11
-- Name: reposicionterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reposicionterminacionprocesopostulado (
    iddecisionterminacion integer NOT NULL,
    idtipoparticipanteaudiencia integer NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.reposicionterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 738 (class 1259 OID 88481)
-- Dependencies: 11
-- Name: reposicionterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reposicionterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    iddecisionterminacion integer,
    idtipoparticipanteaudiencia integer,
    usuario character varying(10)
);


ALTER TABLE public.reposicionterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 739 (class 1259 OID 88484)
-- Dependencies: 11
-- Name: resolucionasignacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE resolucionasignacion (
    idresolucionasignacion integer NOT NULL,
    numero character varying(20) NOT NULL,
    fecha date NOT NULL,
    archivo character varying(255) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.resolucionasignacion OWNER TO postgres;

--
-- TOC entry 740 (class 1259 OID 88487)
-- Dependencies: 11
-- Name: resolucionasignacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE resolucionasignacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idresolucionasignacion integer NOT NULL,
    numero character varying(20) NOT NULL,
    fecha date NOT NULL,
    archivo character varying(255) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.resolucionasignacion_audit OWNER TO postgres;

--
-- TOC entry 741 (class 1259 OID 88490)
-- Dependencies: 739 11
-- Name: resolucionasignacion_idresolucionasignacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE resolucionasignacion_idresolucionasignacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resolucionasignacion_idresolucionasignacion_seq OWNER TO postgres;

--
-- TOC entry 10429 (class 0 OID 0)
-- Dependencies: 741
-- Name: resolucionasignacion_idresolucionasignacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE resolucionasignacion_idresolucionasignacion_seq OWNED BY resolucionasignacion.idresolucionasignacion;


--
-- TOC entry 742 (class 1259 OID 88492)
-- Dependencies: 11
-- Name: rol_idrol_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE rol_idrol_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.rol_idrol_seq OWNER TO postgres;

--
-- TOC entry 743 (class 1259 OID 88494)
-- Dependencies: 7400 11
-- Name: rol; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE rol (
    idrol integer DEFAULT nextval('rol_idrol_seq'::regclass) NOT NULL,
    rol character varying(60) NOT NULL,
    descripcionrol character varying(150) NOT NULL
);


ALTER TABLE public.rol OWNER TO postgres;

--
-- TOC entry 10430 (class 0 OID 0)
-- Dependencies: 743
-- Name: TABLE rol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE rol IS 'Tabla de identificacion del rol';


--
-- TOC entry 10431 (class 0 OID 0)
-- Dependencies: 743
-- Name: COLUMN rol.idrol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN rol.idrol IS 'Identificador unico del rol';


--
-- TOC entry 10432 (class 0 OID 0)
-- Dependencies: 743
-- Name: COLUMN rol.rol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN rol.rol IS 'Tipo de rol';


--
-- TOC entry 10433 (class 0 OID 0)
-- Dependencies: 743
-- Name: COLUMN rol.descripcionrol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN rol.descripcionrol IS 'Descripcion del rol';


--
-- TOC entry 744 (class 1259 OID 88498)
-- Dependencies: 11
-- Name: salaconocimiento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE salaconocimiento (
    idsalaconocimiento integer NOT NULL,
    sala character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.salaconocimiento OWNER TO postgres;

--
-- TOC entry 745 (class 1259 OID 88501)
-- Dependencies: 11
-- Name: salaconocimiento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE salaconocimiento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idsalaconocimiento integer,
    sala character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.salaconocimiento_audit OWNER TO postgres;

--
-- TOC entry 746 (class 1259 OID 88504)
-- Dependencies: 744 11
-- Name: salaconocimiento_idsalaconocimiento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE salaconocimiento_idsalaconocimiento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.salaconocimiento_idsalaconocimiento_seq OWNER TO postgres;

--
-- TOC entry 10434 (class 0 OID 0)
-- Dependencies: 746
-- Name: salaconocimiento_idsalaconocimiento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE salaconocimiento_idsalaconocimiento_seq OWNED BY salaconocimiento.idsalaconocimiento;


--
-- TOC entry 747 (class 1259 OID 88506)
-- Dependencies: 11
-- Name: salaversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE salaversion (
    idsalaversion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    direccion character varying(200) NOT NULL,
    idmunicipio bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.salaversion OWNER TO postgres;

--
-- TOC entry 10435 (class 0 OID 0)
-- Dependencies: 747
-- Name: TABLE salaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE salaversion IS 'Salas de version de justicia y paz.';


--
-- TOC entry 10436 (class 0 OID 0)
-- Dependencies: 747
-- Name: COLUMN salaversion.idsalaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion.idsalaversion IS 'Identificador unico de la sala de version.';


--
-- TOC entry 10437 (class 0 OID 0)
-- Dependencies: 747
-- Name: COLUMN salaversion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion.descripcion IS 'Descripcion de la sala de version.';


--
-- TOC entry 10438 (class 0 OID 0)
-- Dependencies: 747
-- Name: COLUMN salaversion.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion.direccion IS 'Direccion de Ubicacion de la sala de version.';


--
-- TOC entry 10439 (class 0 OID 0)
-- Dependencies: 747
-- Name: COLUMN salaversion.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion.idmunicipio IS 'Municipio de ubicacion de la sala de Version.';


--
-- TOC entry 10440 (class 0 OID 0)
-- Dependencies: 747
-- Name: COLUMN salaversion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 748 (class 1259 OID 88509)
-- Dependencies: 11
-- Name: salaversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE salaversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idsalaversion bigint,
    descripcion character varying(100),
    direccion character varying(200),
    idmunicipio bigint,
    usuario character varying(10)
);


ALTER TABLE public.salaversion_audit OWNER TO postgres;

--
-- TOC entry 10441 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10442 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.fechaactualizacion IS 'Fecha  de actualizacion de la sala de version de Justicia y Paz';


--
-- TOC entry 10443 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.idsalaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.idsalaversion IS 'Identificador unico de la sala de version';


--
-- TOC entry 10444 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.descripcion IS 'Descripcion de la sala de version';


--
-- TOC entry 10445 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.direccion IS 'Direccion de Ubicacion de la sala de version';


--
-- TOC entry 10446 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.idmunicipio IS 'Identifiacador Unico del Municipio de ubicacion de la sala de Version';


--
-- TOC entry 10447 (class 0 OID 0)
-- Dependencies: 748
-- Name: COLUMN salaversion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN salaversion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 749 (class 1259 OID 88512)
-- Dependencies: 747 11
-- Name: salaversion_idsalaversion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE salaversion_idsalaversion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.salaversion_idsalaversion_seq OWNER TO postgres;

--
-- TOC entry 10448 (class 0 OID 0)
-- Dependencies: 749
-- Name: salaversion_idsalaversion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE salaversion_idsalaversion_seq OWNED BY salaversion.idsalaversion;


--
-- TOC entry 750 (class 1259 OID 88514)
-- Dependencies: 11
-- Name: sede; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sede (
    idsede integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.sede OWNER TO postgres;

--
-- TOC entry 10449 (class 0 OID 0)
-- Dependencies: 750
-- Name: TABLE sede; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE sede IS 'Sedes de la Unidad Nacional de Fiscalias para la Justicia y la Paz.';


--
-- TOC entry 10450 (class 0 OID 0)
-- Dependencies: 750
-- Name: COLUMN sede.idsede; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN sede.idsede IS 'Identificador unico de la sede.';


--
-- TOC entry 10451 (class 0 OID 0)
-- Dependencies: 750
-- Name: COLUMN sede.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN sede.descripcion IS 'Descripcion de la sede.';


--
-- TOC entry 10452 (class 0 OID 0)
-- Dependencies: 750
-- Name: COLUMN sede.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN sede.usuario IS 'Usuario que actualiza la sede.';


--
-- TOC entry 751 (class 1259 OID 88517)
-- Dependencies: 750 11
-- Name: sede_idsede_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE sede_idsede_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sede_idsede_seq OWNER TO postgres;

--
-- TOC entry 10453 (class 0 OID 0)
-- Dependencies: 751
-- Name: sede_idsede_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE sede_idsede_seq OWNED BY sede.idsede;


--
-- TOC entry 752 (class 1259 OID 88519)
-- Dependencies: 11
-- Name: senal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE senal (
    idsenal bigint NOT NULL,
    senal character varying(100),
    descripcion character varying(250),
    activo character varying(1) NOT NULL
);


ALTER TABLE public.senal OWNER TO postgres;

--
-- TOC entry 10454 (class 0 OID 0)
-- Dependencies: 752
-- Name: TABLE senal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE senal IS 'Tabla de senales caracteristicas';


--
-- TOC entry 10455 (class 0 OID 0)
-- Dependencies: 752
-- Name: COLUMN senal.idsenal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN senal.idsenal IS 'Identificador unico de senal';


--
-- TOC entry 10456 (class 0 OID 0)
-- Dependencies: 752
-- Name: COLUMN senal.senal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN senal.senal IS 'Senales';


--
-- TOC entry 949 (class 1259 OID 96033)
-- Dependencies: 11
-- Name: senal_idsenal_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE senal_idsenal_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.senal_idsenal_seq OWNER TO postgres;

--
-- TOC entry 753 (class 1259 OID 88522)
-- Dependencies: 11
-- Name: sentenciajyp; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sentenciajyp (
    radicado character varying(21) NOT NULL,
    idaudiencia integer NOT NULL,
    sentencia integer,
    sentenciaalternativa integer,
    usuario character varying(10)
);


ALTER TABLE public.sentenciajyp OWNER TO postgres;

--
-- TOC entry 754 (class 1259 OID 88525)
-- Dependencies: 11
-- Name: sentenciajyp_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sentenciajyp_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    radicado character varying(21),
    idaudiencia integer,
    sentencia integer,
    sentenciaalternativa integer,
    usuario character varying(10)
);


ALTER TABLE public.sentenciajyp_audit OWNER TO postgres;

--
-- TOC entry 755 (class 1259 OID 88528)
-- Dependencies: 11
-- Name: solicitud_idsolicitid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE solicitud_idsolicitid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.solicitud_idsolicitid_seq OWNER TO postgres;

--
-- TOC entry 756 (class 1259 OID 88530)
-- Dependencies: 11
-- Name: solicitudterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE solicitudterminacionprocesopostulado (
    idsolicitudterminacion integer NOT NULL,
    radicado character varying(21) NOT NULL,
    fecharadicacion date NOT NULL,
    despacho integer NOT NULL,
    fiscal character varying(10) NOT NULL,
    idsalaconocimiento integer NOT NULL,
    observacion text NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.solicitudterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 757 (class 1259 OID 88536)
-- Dependencies: 11
-- Name: solicitudterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE solicitudterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idsolicitudterminacion integer,
    radicado character varying(21),
    fecharadicacion date NOT NULL,
    despacho integer NOT NULL,
    fiscal character varying(10),
    idsalaconocimiento integer,
    observacion text,
    usuario character varying(10)
);


ALTER TABLE public.solicitudterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 758 (class 1259 OID 88542)
-- Dependencies: 756 11
-- Name: solicitudterminacionprocesopostulado_idsolicitudterminacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE solicitudterminacionprocesopostulado_idsolicitudterminacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.solicitudterminacionprocesopostulado_idsolicitudterminacion_seq OWNER TO postgres;

--
-- TOC entry 10457 (class 0 OID 0)
-- Dependencies: 758
-- Name: solicitudterminacionprocesopostulado_idsolicitudterminacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE solicitudterminacionprocesopostulado_idsolicitudterminacion_seq OWNED BY solicitudterminacionprocesopostulado.idsolicitudterminacion;


--
-- TOC entry 759 (class 1259 OID 88544)
-- Dependencies: 11
-- Name: subtipodelito; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE subtipodelito (
    idsubtipodelito integer NOT NULL,
    subtipodelito character varying(250) NOT NULL
);


ALTER TABLE public.subtipodelito OWNER TO postgres;

--
-- TOC entry 760 (class 1259 OID 88547)
-- Dependencies: 11
-- Name: tendenciasexual; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tendenciasexual (
    idtendenciasexual integer NOT NULL,
    tendenciasexual character varying(100) NOT NULL,
    usuario character varying NOT NULL
);


ALTER TABLE public.tendenciasexual OWNER TO postgres;

--
-- TOC entry 761 (class 1259 OID 88553)
-- Dependencies: 11
-- Name: tendenciasexual_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tendenciasexual_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtendenciasexual integer,
    tendenciasexual character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tendenciasexual_audit OWNER TO postgres;

--
-- TOC entry 762 (class 1259 OID 88556)
-- Dependencies: 760 11
-- Name: tendenciasexual_idtendenciasexual_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tendenciasexual_idtendenciasexual_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tendenciasexual_idtendenciasexual_seq OWNER TO postgres;

--
-- TOC entry 10458 (class 0 OID 0)
-- Dependencies: 762
-- Name: tendenciasexual_idtendenciasexual_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tendenciasexual_idtendenciasexual_seq OWNED BY tendenciasexual.idtendenciasexual;


--
-- TOC entry 763 (class 1259 OID 88558)
-- Dependencies: 7407 11
-- Name: terminacionetapaprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE terminacionetapaprocesal (
    idterminacionetapaprocesal integer NOT NULL,
    radicado character varying(21) NOT NULL,
    idetapaproceso integer NOT NULL,
    idmotivoterminacionetapapostulado integer NOT NULL,
    fecha date NOT NULL,
    observacion text DEFAULT ''::text,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.terminacionetapaprocesal OWNER TO postgres;

--
-- TOC entry 764 (class 1259 OID 88565)
-- Dependencies: 11
-- Name: terminacionetapaprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE terminacionetapaprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idterminacionetapaprocesal integer,
    radicado character varying(21),
    idetapaproceso integer,
    idmotivoterminacionetapapostulado integer,
    fecha date,
    observacion text,
    usuario character varying(10)
);


ALTER TABLE public.terminacionetapaprocesal_audit OWNER TO postgres;

--
-- TOC entry 765 (class 1259 OID 88571)
-- Dependencies: 763 11
-- Name: terminacionetapaprocesal_idterminacionetapaprocesal_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE terminacionetapaprocesal_idterminacionetapaprocesal_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.terminacionetapaprocesal_idterminacionetapaprocesal_seq OWNER TO postgres;

--
-- TOC entry 10459 (class 0 OID 0)
-- Dependencies: 765
-- Name: terminacionetapaprocesal_idterminacionetapaprocesal_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE terminacionetapaprocesal_idterminacionetapaprocesal_seq OWNED BY terminacionetapaprocesal.idterminacionetapaprocesal;


--
-- TOC entry 766 (class 1259 OID 88573)
-- Dependencies: 11
-- Name: tipoaccesosalud; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaccesosalud (
    idtipoaccesosalud integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipoaccesosalud OWNER TO postgres;

--
-- TOC entry 10460 (class 0 OID 0)
-- Dependencies: 766
-- Name: TABLE tipoaccesosalud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoaccesosalud IS 'Tabla que especifica los tipos de acceso a salud.';


--
-- TOC entry 10461 (class 0 OID 0)
-- Dependencies: 766
-- Name: COLUMN tipoaccesosalud.idtipoaccesosalud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoaccesosalud.idtipoaccesosalud IS 'Identificador del tipo de acceso a salud';


--
-- TOC entry 10462 (class 0 OID 0)
-- Dependencies: 766
-- Name: COLUMN tipoaccesosalud.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoaccesosalud.descripcion IS 'Descripcion del tipo de acceso a salud';


--
-- TOC entry 767 (class 1259 OID 88576)
-- Dependencies: 11
-- Name: tipoaccesosalud_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaccesosalud_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoaccesosalud integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipoaccesosalud_audit OWNER TO postgres;

--
-- TOC entry 768 (class 1259 OID 88579)
-- Dependencies: 766 11
-- Name: tipoaccesosalud_idtipoaccesosalud_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoaccesosalud_idtipoaccesosalud_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoaccesosalud_idtipoaccesosalud_seq OWNER TO postgres;

--
-- TOC entry 10463 (class 0 OID 0)
-- Dependencies: 768
-- Name: tipoaccesosalud_idtipoaccesosalud_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoaccesosalud_idtipoaccesosalud_seq OWNED BY tipoaccesosalud.idtipoaccesosalud;


--
-- TOC entry 769 (class 1259 OID 88581)
-- Dependencies: 11
-- Name: tipoactaasignacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoactaasignacion (
    idtipoactaasignacion integer NOT NULL,
    tipoactaasignacion character varying(100) NOT NULL,
    idtipopostulado integer,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoactaasignacion OWNER TO postgres;

--
-- TOC entry 770 (class 1259 OID 88584)
-- Dependencies: 11
-- Name: tipoactaasignacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoactaasignacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoactaasignacion integer,
    tipoactaasignacion character varying(100),
    idtipopostulado integer,
    usuario character varying(10)
);


ALTER TABLE public.tipoactaasignacion_audit OWNER TO postgres;

--
-- TOC entry 771 (class 1259 OID 88587)
-- Dependencies: 769 11
-- Name: tipoactaasignacion_idtipoactaasignacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoactaasignacion_idtipoactaasignacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoactaasignacion_idtipoactaasignacion_seq OWNER TO postgres;

--
-- TOC entry 10464 (class 0 OID 0)
-- Dependencies: 771
-- Name: tipoactaasignacion_idtipoactaasignacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoactaasignacion_idtipoactaasignacion_seq OWNED BY tipoactaasignacion.idtipoactaasignacion;


--
-- TOC entry 772 (class 1259 OID 88589)
-- Dependencies: 7411 11
-- Name: tipoactuacionhistoricoprocesal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoactuacionhistoricoprocesal (
    idtipoactuacionhistoricoprocesal integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    idtipoley bigint DEFAULT 0 NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoactuacionhistoricoprocesal OWNER TO postgres;

--
-- TOC entry 10465 (class 0 OID 0)
-- Dependencies: 772
-- Name: COLUMN tipoactuacionhistoricoprocesal.idtipoactuacionhistoricoprocesal; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoactuacionhistoricoprocesal.idtipoactuacionhistoricoprocesal IS 'Identificador unico del tipo de actuacion historico procesal.';


--
-- TOC entry 10466 (class 0 OID 0)
-- Dependencies: 772
-- Name: COLUMN tipoactuacionhistoricoprocesal.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoactuacionhistoricoprocesal.descripcion IS 'Descripcion del tipo de actuacion historico procesal.';


--
-- TOC entry 10467 (class 0 OID 0)
-- Dependencies: 772
-- Name: COLUMN tipoactuacionhistoricoprocesal.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoactuacionhistoricoprocesal.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 773 (class 1259 OID 88593)
-- Dependencies: 772 11
-- Name: tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq OWNER TO postgres;

--
-- TOC entry 10468 (class 0 OID 0)
-- Dependencies: 773
-- Name: tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq OWNED BY tipoactuacionhistoricoprocesal.idtipoactuacionhistoricoprocesal;


--
-- TOC entry 774 (class 1259 OID 88595)
-- Dependencies: 11
-- Name: tipoactuacionhistoricoprocesal_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoactuacionhistoricoprocesal_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoactuacionhistoricoprocesal bigint,
    descripcion character varying(100),
    idtipoley bigint,
    usuario character varying(10)
);


ALTER TABLE public.tipoactuacionhistoricoprocesal_audit OWNER TO postgres;

--
-- TOC entry 775 (class 1259 OID 88598)
-- Dependencies: 11
-- Name: tipoadquisicion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoadquisicion (
    idtipoadquisicion integer NOT NULL,
    descripcion character varying(100)
);


ALTER TABLE public.tipoadquisicion OWNER TO postgres;

--
-- TOC entry 10469 (class 0 OID 0)
-- Dependencies: 775
-- Name: TABLE tipoadquisicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoadquisicion IS 'Tabla de tipo de adquisicion';


--
-- TOC entry 10470 (class 0 OID 0)
-- Dependencies: 775
-- Name: COLUMN tipoadquisicion.idtipoadquisicion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoadquisicion.idtipoadquisicion IS 'Identificador unico del tipo de adquisicion';


--
-- TOC entry 10471 (class 0 OID 0)
-- Dependencies: 775
-- Name: COLUMN tipoadquisicion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoadquisicion.descripcion IS 'Descripcion del tipo de adquisicion';


--
-- TOC entry 776 (class 1259 OID 88601)
-- Dependencies: 775 11
-- Name: tipoadquisicion_idtipoadquisicion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoadquisicion_idtipoadquisicion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoadquisicion_idtipoadquisicion_seq OWNER TO postgres;

--
-- TOC entry 10472 (class 0 OID 0)
-- Dependencies: 776
-- Name: tipoadquisicion_idtipoadquisicion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoadquisicion_idtipoadquisicion_seq OWNED BY tipoadquisicion.idtipoadquisicion;


--
-- TOC entry 777 (class 1259 OID 88603)
-- Dependencies: 11
-- Name: tipoalbumfotografico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoalbumfotografico (
    idtipoalbumfotografico integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoalbumfotografico OWNER TO postgres;

--
-- TOC entry 10473 (class 0 OID 0)
-- Dependencies: 777
-- Name: TABLE tipoalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoalbumfotografico IS 'Tipo de album fotografico';


--
-- TOC entry 10474 (class 0 OID 0)
-- Dependencies: 777
-- Name: COLUMN tipoalbumfotografico.idtipoalbumfotografico; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoalbumfotografico.idtipoalbumfotografico IS 'Identificador unico de tipo de fotografico';


--
-- TOC entry 10475 (class 0 OID 0)
-- Dependencies: 777
-- Name: COLUMN tipoalbumfotografico.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoalbumfotografico.descripcion IS 'Descripcion del tipo de album Fotografico';


--
-- TOC entry 10476 (class 0 OID 0)
-- Dependencies: 777
-- Name: COLUMN tipoalbumfotografico.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoalbumfotografico.usuario IS 'Usuario que realiza la ultima actualizacion sobre el registro';


--
-- TOC entry 778 (class 1259 OID 88606)
-- Dependencies: 11
-- Name: tipoalbumfotografico_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoalbumfotografico_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoalbumfotografico integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoalbumfotografico_audit OWNER TO postgres;

--
-- TOC entry 779 (class 1259 OID 88609)
-- Dependencies: 777 11
-- Name: tipoalbumfotografico_idtipoalbumfotografico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoalbumfotografico_idtipoalbumfotografico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoalbumfotografico_idtipoalbumfotografico_seq OWNER TO postgres;

--
-- TOC entry 10477 (class 0 OID 0)
-- Dependencies: 779
-- Name: tipoalbumfotografico_idtipoalbumfotografico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoalbumfotografico_idtipoalbumfotografico_seq OWNED BY tipoalbumfotografico.idtipoalbumfotografico;


--
-- TOC entry 780 (class 1259 OID 88611)
-- Dependencies: 11
-- Name: tipoaplicaley; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaplicaley (
    idtipoaplicaley integer NOT NULL,
    descripcion character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.tipoaplicaley OWNER TO postgres;

--
-- TOC entry 781 (class 1259 OID 88614)
-- Dependencies: 11
-- Name: tipoaplicaley_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaplicaley_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoaplicaley integer NOT NULL,
    descripcion character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.tipoaplicaley_audit OWNER TO postgres;

--
-- TOC entry 782 (class 1259 OID 88617)
-- Dependencies: 780 11
-- Name: tipoaplicaley_idtipoaplicaley_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoaplicaley_idtipoaplicaley_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoaplicaley_idtipoaplicaley_seq OWNER TO postgres;

--
-- TOC entry 10478 (class 0 OID 0)
-- Dependencies: 782
-- Name: tipoaplicaley_idtipoaplicaley_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoaplicaley_idtipoaplicaley_seq OWNED BY tipoaplicaley.idtipoaplicaley;


--
-- TOC entry 783 (class 1259 OID 88619)
-- Dependencies: 11
-- Name: tipoapoderado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoapoderado (
    idtipoapoderado integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoapoderado OWNER TO postgres;

--
-- TOC entry 10479 (class 0 OID 0)
-- Dependencies: 783
-- Name: TABLE tipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoapoderado IS 'Tipos de Apoderados';


--
-- TOC entry 10480 (class 0 OID 0)
-- Dependencies: 783
-- Name: COLUMN tipoapoderado.idtipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado.idtipoapoderado IS 'Identificador unico del Tipo de apoderado';


--
-- TOC entry 10481 (class 0 OID 0)
-- Dependencies: 783
-- Name: COLUMN tipoapoderado.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado.descripcion IS 'Descripcion del tipo de apoderado';


--
-- TOC entry 10482 (class 0 OID 0)
-- Dependencies: 783
-- Name: COLUMN tipoapoderado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado.usuario IS 'Usuario que realizao la ultima actualizacion sobre la tabla.';


--
-- TOC entry 784 (class 1259 OID 88622)
-- Dependencies: 11
-- Name: tipoapoderado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoapoderado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoapoderado bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoapoderado_audit OWNER TO postgres;

--
-- TOC entry 10483 (class 0 OID 0)
-- Dependencies: 784
-- Name: COLUMN tipoapoderado_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10484 (class 0 OID 0)
-- Dependencies: 784
-- Name: COLUMN tipoapoderado_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado_audit.fechaactualizacion IS 'Fecha en la que se hace la actualizacion del tipo de apoderado';


--
-- TOC entry 10485 (class 0 OID 0)
-- Dependencies: 784
-- Name: COLUMN tipoapoderado_audit.idtipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado_audit.idtipoapoderado IS 'Identificador unico del Tipo de apoderado';


--
-- TOC entry 10486 (class 0 OID 0)
-- Dependencies: 784
-- Name: COLUMN tipoapoderado_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado_audit.descripcion IS 'Descripcion del tipo de apoderado';


--
-- TOC entry 10487 (class 0 OID 0)
-- Dependencies: 784
-- Name: COLUMN tipoapoderado_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoapoderado_audit.usuario IS 'Usuario que realizao la ultima actualizacion sobre la tabla';


--
-- TOC entry 785 (class 1259 OID 88625)
-- Dependencies: 783 11
-- Name: tipoapoderado_idtipoapoderado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoapoderado_idtipoapoderado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoapoderado_idtipoapoderado_seq OWNER TO postgres;

--
-- TOC entry 10488 (class 0 OID 0)
-- Dependencies: 785
-- Name: tipoapoderado_idtipoapoderado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoapoderado_idtipoapoderado_seq OWNED BY tipoapoderado.idtipoapoderado;


--
-- TOC entry 786 (class 1259 OID 88627)
-- Dependencies: 11
-- Name: tipoaudiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaudiencia (
    tipoaudiencia character varying(100),
    idtipoaudiencia integer NOT NULL,
    prioridad integer,
    usuario character varying(10)
);


ALTER TABLE public.tipoaudiencia OWNER TO postgres;

--
-- TOC entry 787 (class 1259 OID 88630)
-- Dependencies: 11
-- Name: tipoaudiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoaudiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    tipoaudiencia character varying(100),
    idtipoaudiencia integer NOT NULL,
    prioridad integer,
    usuario character varying(10)
);


ALTER TABLE public.tipoaudiencia_audit OWNER TO postgres;

--
-- TOC entry 788 (class 1259 OID 88633)
-- Dependencies: 787 11
-- Name: tipoaudiencia_audit_idtipoaudiencia_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoaudiencia_audit_idtipoaudiencia_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoaudiencia_audit_idtipoaudiencia_seq OWNER TO postgres;

--
-- TOC entry 10489 (class 0 OID 0)
-- Dependencies: 788
-- Name: tipoaudiencia_audit_idtipoaudiencia_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoaudiencia_audit_idtipoaudiencia_seq OWNED BY tipoaudiencia_audit.idtipoaudiencia;


--
-- TOC entry 789 (class 1259 OID 88635)
-- Dependencies: 786 11
-- Name: tipoaudiencia_idtipoaudiencia_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoaudiencia_idtipoaudiencia_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoaudiencia_idtipoaudiencia_seq OWNER TO postgres;

--
-- TOC entry 10490 (class 0 OID 0)
-- Dependencies: 789
-- Name: tipoaudiencia_idtipoaudiencia_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoaudiencia_idtipoaudiencia_seq OWNED BY tipoaudiencia.idtipoaudiencia;


--
-- TOC entry 790 (class 1259 OID 88637)
-- Dependencies: 11
-- Name: tipobien; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipobien (
    idtipobien integer NOT NULL,
    descripcion character varying(100)
);


ALTER TABLE public.tipobien OWNER TO postgres;

--
-- TOC entry 10491 (class 0 OID 0)
-- Dependencies: 790
-- Name: TABLE tipobien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipobien IS 'Tabla de tipo de bien';


--
-- TOC entry 10492 (class 0 OID 0)
-- Dependencies: 790
-- Name: COLUMN tipobien.idtipobien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipobien.idtipobien IS 'Identficador unico del tipo de bien';


--
-- TOC entry 10493 (class 0 OID 0)
-- Dependencies: 790
-- Name: COLUMN tipobien.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipobien.descripcion IS 'Descripcion del tipo de bien';


--
-- TOC entry 791 (class 1259 OID 88640)
-- Dependencies: 790 11
-- Name: tipobien_idtipobien_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipobien_idtipobien_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipobien_idtipobien_seq OWNER TO postgres;

--
-- TOC entry 10494 (class 0 OID 0)
-- Dependencies: 791
-- Name: tipobien_idtipobien_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipobien_idtipobien_seq OWNED BY tipobien.idtipobien;


--
-- TOC entry 792 (class 1259 OID 88642)
-- Dependencies: 11
-- Name: tipocaratula; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipocaratula (
    idtipocaratula integer NOT NULL,
    idtipoprocesojyp integer NOT NULL,
    tipocaratula character varying(200) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipocaratula OWNER TO postgres;

--
-- TOC entry 793 (class 1259 OID 88645)
-- Dependencies: 11
-- Name: tipocaratula_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipocaratula_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipocaratula integer,
    idtipoprocesojyp integer,
    tipocaratula character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.tipocaratula_audit OWNER TO postgres;

--
-- TOC entry 794 (class 1259 OID 88648)
-- Dependencies: 792 11
-- Name: tipocaratula_idtipocaratula_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipocaratula_idtipocaratula_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipocaratula_idtipocaratula_seq OWNER TO postgres;

--
-- TOC entry 10495 (class 0 OID 0)
-- Dependencies: 794
-- Name: tipocaratula_idtipocaratula_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipocaratula_idtipocaratula_seq OWNED BY tipocaratula.idtipocaratula;


--
-- TOC entry 795 (class 1259 OID 88650)
-- Dependencies: 11
-- Name: tipoclasificacionpersonajuridica; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoclasificacionpersonajuridica (
    idtipoclasificacionpersonajuridica integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipoclasificacionpersonajuridica OWNER TO postgres;

--
-- TOC entry 10496 (class 0 OID 0)
-- Dependencies: 795
-- Name: TABLE tipoclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoclasificacionpersonajuridica IS 'Tabla que especifica los tipos de clasificacion de la persona juridica.';


--
-- TOC entry 10497 (class 0 OID 0)
-- Dependencies: 795
-- Name: COLUMN tipoclasificacionpersonajuridica.idtipoclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoclasificacionpersonajuridica.idtipoclasificacionpersonajuridica IS 'Identificador del tipo de clasificacion de la persona juridica';


--
-- TOC entry 10498 (class 0 OID 0)
-- Dependencies: 795
-- Name: COLUMN tipoclasificacionpersonajuridica.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoclasificacionpersonajuridica.descripcion IS 'Descripcion del tipo de clasificacion de la persona juridica';


--
-- TOC entry 796 (class 1259 OID 88653)
-- Dependencies: 795 11
-- Name: tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq OWNER TO postgres;

--
-- TOC entry 10499 (class 0 OID 0)
-- Dependencies: 796
-- Name: tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq OWNED BY tipoclasificacionpersonajuridica.idtipoclasificacionpersonajuridica;


--
-- TOC entry 797 (class 1259 OID 88655)
-- Dependencies: 11
-- Name: tipoclasificacionpersonajuridica_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoclasificacionpersonajuridica_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoclasificacionpersonajuridica integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipoclasificacionpersonajuridica_audit OWNER TO postgres;

--
-- TOC entry 798 (class 1259 OID 88658)
-- Dependencies: 11
-- Name: tipocompulsacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipocompulsacion (
    idtipocompulsacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipocompulsacion OWNER TO postgres;

--
-- TOC entry 10500 (class 0 OID 0)
-- Dependencies: 798
-- Name: COLUMN tipocompulsacion.idtipocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocompulsacion.idtipocompulsacion IS 'Identifcador unico del tipo de compulsacion.';


--
-- TOC entry 10501 (class 0 OID 0)
-- Dependencies: 798
-- Name: COLUMN tipocompulsacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocompulsacion.descripcion IS 'Descripcion del tipo de compulsacion.';


--
-- TOC entry 10502 (class 0 OID 0)
-- Dependencies: 798
-- Name: COLUMN tipocompulsacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocompulsacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 799 (class 1259 OID 88661)
-- Dependencies: 11
-- Name: tipocompulsacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipocompulsacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipocompulsacion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipocompulsacion_audit OWNER TO postgres;

--
-- TOC entry 800 (class 1259 OID 88664)
-- Dependencies: 798 11
-- Name: tipocompulsacion_idtipocompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipocompulsacion_idtipocompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipocompulsacion_idtipocompulsacion_seq OWNER TO postgres;

--
-- TOC entry 10503 (class 0 OID 0)
-- Dependencies: 800
-- Name: tipocompulsacion_idtipocompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipocompulsacion_idtipocompulsacion_seq OWNED BY tipocompulsacion.idtipocompulsacion;


--
-- TOC entry 801 (class 1259 OID 88666)
-- Dependencies: 11
-- Name: tipodesolicitud_idtipodesolicitud_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodesolicitud_idtipodesolicitud_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.tipodesolicitud_idtipodesolicitud_seq OWNER TO postgres;

--
-- TOC entry 802 (class 1259 OID 88668)
-- Dependencies: 7422 11
-- Name: tipodesolicitud; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodesolicitud (
    idtipodesolicitud integer DEFAULT nextval('tipodesolicitud_idtipodesolicitud_seq'::regclass) NOT NULL,
    tipodesolicitud character varying(100) NOT NULL,
    requiereautorizacion character varying(2) NOT NULL,
    idperfil integer NOT NULL
);


ALTER TABLE public.tipodesolicitud OWNER TO postgres;

--
-- TOC entry 10504 (class 0 OID 0)
-- Dependencies: 802
-- Name: TABLE tipodesolicitud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodesolicitud IS 'Tabla de tipo de solicitud';


--
-- TOC entry 10505 (class 0 OID 0)
-- Dependencies: 802
-- Name: COLUMN tipodesolicitud.idtipodesolicitud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodesolicitud.idtipodesolicitud IS 'Indentificador unico del tipo de solicitud';


--
-- TOC entry 10506 (class 0 OID 0)
-- Dependencies: 802
-- Name: COLUMN tipodesolicitud.tipodesolicitud; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodesolicitud.tipodesolicitud IS 'Tipo de solicitud';


--
-- TOC entry 10507 (class 0 OID 0)
-- Dependencies: 802
-- Name: COLUMN tipodesolicitud.requiereautorizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodesolicitud.requiereautorizacion IS 'Especificar si requiere autorizacion';


--
-- TOC entry 10508 (class 0 OID 0)
-- Dependencies: 802
-- Name: COLUMN tipodesolicitud.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodesolicitud.idperfil IS 'Identificador unico de perfil';


--
-- TOC entry 803 (class 1259 OID 88672)
-- Dependencies: 11
-- Name: tipodiscapacidad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodiscapacidad (
    idtipodiscapacidad integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipodiscapacidad OWNER TO postgres;

--
-- TOC entry 10509 (class 0 OID 0)
-- Dependencies: 803
-- Name: TABLE tipodiscapacidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodiscapacidad IS 'Tabla que especifica los tipos de discapacidad.';


--
-- TOC entry 10510 (class 0 OID 0)
-- Dependencies: 803
-- Name: COLUMN tipodiscapacidad.idtipodiscapacidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodiscapacidad.idtipodiscapacidad IS 'Identificador del tipo de discapacidad';


--
-- TOC entry 10511 (class 0 OID 0)
-- Dependencies: 803
-- Name: COLUMN tipodiscapacidad.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodiscapacidad.descripcion IS 'Descripcion del tipo de discapacidad';


--
-- TOC entry 804 (class 1259 OID 88675)
-- Dependencies: 11
-- Name: tipodiscapacidad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodiscapacidad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodiscapacidad integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipodiscapacidad_audit OWNER TO postgres;

--
-- TOC entry 805 (class 1259 OID 88678)
-- Dependencies: 803 11
-- Name: tipodiscapacidad_idtipodiscapacidad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodiscapacidad_idtipodiscapacidad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodiscapacidad_idtipodiscapacidad_seq OWNER TO postgres;

--
-- TOC entry 10512 (class 0 OID 0)
-- Dependencies: 805
-- Name: tipodiscapacidad_idtipodiscapacidad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodiscapacidad_idtipodiscapacidad_seq OWNED BY tipodiscapacidad.idtipodiscapacidad;


--
-- TOC entry 806 (class 1259 OID 88680)
-- Dependencies: 11
-- Name: tipodocumento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumento (
    idtipodocumento integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipodocumento OWNER TO postgres;

--
-- TOC entry 10513 (class 0 OID 0)
-- Dependencies: 806
-- Name: TABLE tipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumento IS 'Tipos de documentos';


--
-- TOC entry 10514 (class 0 OID 0)
-- Dependencies: 806
-- Name: COLUMN tipodocumento.idtipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.idtipodocumento IS 'Identificador unico del Tipo de documento';


--
-- TOC entry 10515 (class 0 OID 0)
-- Dependencies: 806
-- Name: COLUMN tipodocumento.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.descripcion IS 'Descripcion del tipo de documento';


--
-- TOC entry 10516 (class 0 OID 0)
-- Dependencies: 806
-- Name: COLUMN tipodocumento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.usuario IS 'Usuario que realizao la ultima actualizacion sobre la tabla.';


--
-- TOC entry 807 (class 1259 OID 88683)
-- Dependencies: 11
-- Name: tipodocumento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumento bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumento_audit OWNER TO postgres;

--
-- TOC entry 10517 (class 0 OID 0)
-- Dependencies: 807
-- Name: TABLE tipodocumento_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumento_audit IS 'Tipos de documentos';


--
-- TOC entry 10518 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN tipodocumento_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10519 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN tipodocumento_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo de documento';


--
-- TOC entry 10520 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN tipodocumento_audit.idtipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento_audit.idtipodocumento IS 'Identificador unico del Tipo de documento';


--
-- TOC entry 10521 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN tipodocumento_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento_audit.descripcion IS 'Descripcion del tipo de documento';


--
-- TOC entry 10522 (class 0 OID 0)
-- Dependencies: 807
-- Name: COLUMN tipodocumento_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento_audit.usuario IS 'Usuario que realizo la ultima actualizacion';


--
-- TOC entry 808 (class 1259 OID 88687)
-- Dependencies: 806 11
-- Name: tipodocumento_idtipodocumento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumento_idtipodocumento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumento_idtipodocumento_seq OWNER TO postgres;

--
-- TOC entry 10523 (class 0 OID 0)
-- Dependencies: 808
-- Name: tipodocumento_idtipodocumento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumento_idtipodocumento_seq OWNED BY tipodocumento.idtipodocumento;


--
-- TOC entry 809 (class 1259 OID 88691)
-- Dependencies: 11
-- Name: tipodocumentocarpeta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentocarpeta (
    idtipodocumentocarpeta integer NOT NULL,
    tipodocumentocarpeta character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipodocumentocarpeta OWNER TO postgres;

--
-- TOC entry 10524 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN tipodocumentocarpeta.idtipodocumentocarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocarpeta.idtipodocumentocarpeta IS 'Identificador unico del tipo de documento de carpeta.';


--
-- TOC entry 10525 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN tipodocumentocarpeta.tipodocumentocarpeta; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocarpeta.tipodocumentocarpeta IS 'descripcion del tipo de documento de carpeta.';


--
-- TOC entry 10526 (class 0 OID 0)
-- Dependencies: 809
-- Name: COLUMN tipodocumentocarpeta.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocarpeta.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 810 (class 1259 OID 88694)
-- Dependencies: 11
-- Name: tipodocumentocarpeta_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentocarpeta_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentocarpeta integer,
    tipodocumentocarpeta character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentocarpeta_audit OWNER TO postgres;

--
-- TOC entry 811 (class 1259 OID 88697)
-- Dependencies: 809 11
-- Name: tipodocumentocarpeta_idtipodocumentocarpeta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentocarpeta_idtipodocumentocarpeta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentocarpeta_idtipodocumentocarpeta_seq OWNER TO postgres;

--
-- TOC entry 10527 (class 0 OID 0)
-- Dependencies: 811
-- Name: tipodocumentocarpeta_idtipodocumentocarpeta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentocarpeta_idtipodocumentocarpeta_seq OWNED BY tipodocumentocarpeta.idtipodocumentocarpeta;


--
-- TOC entry 812 (class 1259 OID 88699)
-- Dependencies: 11
-- Name: tipodocumentocompulsacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentocompulsacion (
    idtipodocumentocompulsacion integer NOT NULL,
    descripcion character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentocompulsacion OWNER TO postgres;

--
-- TOC entry 10528 (class 0 OID 0)
-- Dependencies: 812
-- Name: TABLE tipodocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentocompulsacion IS 'Tipo de documento asociado a la compulsacion.';


--
-- TOC entry 10529 (class 0 OID 0)
-- Dependencies: 812
-- Name: COLUMN tipodocumentocompulsacion.idtipodocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion.idtipodocumentocompulsacion IS 'Identificador unico del tipo de documento de la compulsacion.';


--
-- TOC entry 10530 (class 0 OID 0)
-- Dependencies: 812
-- Name: COLUMN tipodocumentocompulsacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion.descripcion IS 'Descripcion especifica del tipo de documento de la compulsacion.';


--
-- TOC entry 10531 (class 0 OID 0)
-- Dependencies: 812
-- Name: COLUMN tipodocumentocompulsacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 813 (class 1259 OID 88702)
-- Dependencies: 11
-- Name: tipodocumentocompulsacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentocompulsacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentocompulsacion integer NOT NULL,
    descripcion character varying(50),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentocompulsacion_audit OWNER TO postgres;

--
-- TOC entry 10532 (class 0 OID 0)
-- Dependencies: 813
-- Name: TABLE tipodocumentocompulsacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentocompulsacion_audit IS 'Control del tipo de documento asociado a la compulsacion.';


--
-- TOC entry 10533 (class 0 OID 0)
-- Dependencies: 813
-- Name: COLUMN tipodocumentocompulsacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion_audit.accion IS 'Descripcion de la accion realizada.';


--
-- TOC entry 10534 (class 0 OID 0)
-- Dependencies: 813
-- Name: COLUMN tipodocumentocompulsacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion_audit.fechaactualizacion IS 'Fecha capturada de la ultima actualizacion realizada sobre la tabla.';


--
-- TOC entry 10535 (class 0 OID 0)
-- Dependencies: 813
-- Name: COLUMN tipodocumentocompulsacion_audit.idtipodocumentocompulsacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion_audit.idtipodocumentocompulsacion IS 'Identificador unico del tipo de documento de la compulsacion.';


--
-- TOC entry 10536 (class 0 OID 0)
-- Dependencies: 813
-- Name: COLUMN tipodocumentocompulsacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion_audit.descripcion IS 'Descripcion especifica del tipo de documento de la compulsacion.';


--
-- TOC entry 10537 (class 0 OID 0)
-- Dependencies: 813
-- Name: COLUMN tipodocumentocompulsacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentocompulsacion_audit.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 814 (class 1259 OID 88705)
-- Dependencies: 813 11
-- Name: tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq OWNER TO postgres;

--
-- TOC entry 10538 (class 0 OID 0)
-- Dependencies: 814
-- Name: tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq OWNED BY tipodocumentocompulsacion_audit.idtipodocumentocompulsacion;


--
-- TOC entry 815 (class 1259 OID 88707)
-- Dependencies: 812 11
-- Name: tipodocumentocompulsacion_idtipodocumentocompulsacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentocompulsacion_idtipodocumentocompulsacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentocompulsacion_idtipodocumentocompulsacion_seq OWNER TO postgres;

--
-- TOC entry 10539 (class 0 OID 0)
-- Dependencies: 815
-- Name: tipodocumentocompulsacion_idtipodocumentocompulsacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentocompulsacion_idtipodocumentocompulsacion_seq OWNED BY tipodocumentocompulsacion.idtipodocumentocompulsacion;


--
-- TOC entry 816 (class 1259 OID 88709)
-- Dependencies: 11
-- Name: tipodocumentoedictoemplazatorio; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentoedictoemplazatorio (
    idtipodocumentoedictoemplazatorio integer NOT NULL,
    tipodocumentoedictoemplazatorio character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipodocumentoedictoemplazatorio OWNER TO postgres;

--
-- TOC entry 817 (class 1259 OID 88712)
-- Dependencies: 816 11
-- Name: tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq OWNER TO postgres;

--
-- TOC entry 10540 (class 0 OID 0)
-- Dependencies: 817
-- Name: tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq OWNED BY tipodocumentoedictoemplazatorio.idtipodocumentoedictoemplazatorio;


--
-- TOC entry 818 (class 1259 OID 88714)
-- Dependencies: 11
-- Name: tipodocumentoedictoemplazatorio_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentoedictoemplazatorio_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentoedictoemplazatorio integer,
    tipodocumentoedictoemplazatorio character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentoedictoemplazatorio_audit OWNER TO postgres;

--
-- TOC entry 819 (class 1259 OID 88717)
-- Dependencies: 11
-- Name: tipodocumentoidentidad_idtipodocumentoidentidad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentoidentidad_idtipodocumentoidentidad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.tipodocumentoidentidad_idtipodocumentoidentidad_seq OWNER TO postgres;

--
-- TOC entry 820 (class 1259 OID 88719)
-- Dependencies: 7429 7430 7431 11
-- Name: tipodocumentoidentidad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentoidentidad (
    idtipodocumentoidentidad integer DEFAULT nextval('tipodocumentoidentidad_idtipodocumentoidentidad_seq'::regclass) NOT NULL,
    tipodocumentoidentidad character varying(60) NOT NULL,
    idtipopersona integer DEFAULT 1 NOT NULL,
    usuario character varying(10) DEFAULT 'jimmcruz'::character varying NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipodocumentoidentidad OWNER TO postgres;

--
-- TOC entry 10541 (class 0 OID 0)
-- Dependencies: 820
-- Name: TABLE tipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentoidentidad IS 'Tipo de documento de identidad';


--
-- TOC entry 10542 (class 0 OID 0)
-- Dependencies: 820
-- Name: COLUMN tipodocumentoidentidad.idtipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentoidentidad.idtipodocumentoidentidad IS 'Identificador unico del tipo de documento de identidad';


--
-- TOC entry 10543 (class 0 OID 0)
-- Dependencies: 820
-- Name: COLUMN tipodocumentoidentidad.tipodocumentoidentidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentoidentidad.tipodocumentoidentidad IS 'Tipo de documento de identidad';


--
-- TOC entry 10544 (class 0 OID 0)
-- Dependencies: 820
-- Name: COLUMN tipodocumentoidentidad.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentoidentidad.idtipopersona IS 'Tipo de persona.';


--
-- TOC entry 10545 (class 0 OID 0)
-- Dependencies: 820
-- Name: COLUMN tipodocumentoidentidad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentoidentidad.usuario IS 'Usuario que realiza la ultima accion.';


--
-- TOC entry 10546 (class 0 OID 0)
-- Dependencies: 820
-- Name: COLUMN tipodocumentoidentidad.ip; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentoidentidad.ip IS 'Ip de ultima accion.';


--
-- TOC entry 821 (class 1259 OID 88725)
-- Dependencies: 11
-- Name: tipodocumentoidentidad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentoidentidad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentoidentidad integer,
    tipodocumentoidentidad character varying(60),
    idtipopersona integer,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipodocumentoidentidad_audit OWNER TO postgres;

--
-- TOC entry 822 (class 1259 OID 88728)
-- Dependencies: 11
-- Name: tipodocumentopersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentopersona (
    idtipodocumentopersona integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipodocumentopersona OWNER TO postgres;

--
-- TOC entry 10547 (class 0 OID 0)
-- Dependencies: 822
-- Name: TABLE tipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentopersona IS 'Tipos de documentos de persona.';


--
-- TOC entry 10548 (class 0 OID 0)
-- Dependencies: 822
-- Name: COLUMN tipodocumentopersona.idtipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona.idtipodocumentopersona IS 'Numero unico del Tipo de Documento de Persona';


--
-- TOC entry 10549 (class 0 OID 0)
-- Dependencies: 822
-- Name: COLUMN tipodocumentopersona.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona.descripcion IS 'Descripcion del Tipo de Documento de Persona';


--
-- TOC entry 10550 (class 0 OID 0)
-- Dependencies: 822
-- Name: COLUMN tipodocumentopersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona.usuario IS 'Usuario que realizo la ultima actualizacion.';


--
-- TOC entry 823 (class 1259 OID 88731)
-- Dependencies: 11
-- Name: tipodocumentopersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentopersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentopersona bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentopersona_audit OWNER TO postgres;

--
-- TOC entry 10551 (class 0 OID 0)
-- Dependencies: 823
-- Name: TABLE tipodocumentopersona_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentopersona_audit IS 'Tipos de documentos de persona
';


--
-- TOC entry 10552 (class 0 OID 0)
-- Dependencies: 823
-- Name: COLUMN tipodocumentopersona_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10553 (class 0 OID 0)
-- Dependencies: 823
-- Name: COLUMN tipodocumentopersona_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona_audit.fechaactualizacion IS 'Fecha de actializacion del tipo de documento de persona';


--
-- TOC entry 10554 (class 0 OID 0)
-- Dependencies: 823
-- Name: COLUMN tipodocumentopersona_audit.idtipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona_audit.idtipodocumentopersona IS 'Numero unico del Tipo de Documento de Persona';


--
-- TOC entry 10555 (class 0 OID 0)
-- Dependencies: 823
-- Name: COLUMN tipodocumentopersona_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona_audit.descripcion IS 'Descripcion del Tipo de Documento de Persona';


--
-- TOC entry 10556 (class 0 OID 0)
-- Dependencies: 823
-- Name: COLUMN tipodocumentopersona_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopersona_audit.usuario IS 'Usuario que realizo la ultima actualizacion';


--
-- TOC entry 824 (class 1259 OID 88734)
-- Dependencies: 822 11
-- Name: tipodocumentopersona_idtipodocumentopersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentopersona_idtipodocumentopersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentopersona_idtipodocumentopersona_seq OWNER TO postgres;

--
-- TOC entry 10557 (class 0 OID 0)
-- Dependencies: 824
-- Name: tipodocumentopersona_idtipodocumentopersona_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentopersona_idtipodocumentopersona_seq OWNED BY tipodocumentopersona.idtipodocumentopersona;


--
-- TOC entry 825 (class 1259 OID 88736)
-- Dependencies: 11
-- Name: tipodocumentopostulacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentopostulacion (
    idtipodocumentopostulacion integer NOT NULL,
    tipodocumentopostulacion character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipodocumentopostulacion OWNER TO postgres;

--
-- TOC entry 10558 (class 0 OID 0)
-- Dependencies: 825
-- Name: COLUMN tipodocumentopostulacion.idtipodocumentopostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopostulacion.idtipodocumentopostulacion IS 'Identificador unico del tipo de documento de postulacion.
 * DE 1 A 99, DOCUMENTOS DE EXCLUSION.
 * DE 101 A 200 DOCUMENTOS DE ANULACION.
 * DE 201 EN ADELANTE CUALQUIER OTRO DOCUMENTO.
 * 100 DOCUMENTO DE NO RATIFICACION';


--
-- TOC entry 10559 (class 0 OID 0)
-- Dependencies: 825
-- Name: COLUMN tipodocumentopostulacion.tipodocumentopostulacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopostulacion.tipodocumentopostulacion IS 'descripcion del tipo de documento de postulacion.';


--
-- TOC entry 10560 (class 0 OID 0)
-- Dependencies: 825
-- Name: COLUMN tipodocumentopostulacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentopostulacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 826 (class 1259 OID 88739)
-- Dependencies: 11
-- Name: tipodocumentopostulacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentopostulacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipodocumentopostulacion integer,
    tipodocumentopostulacion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipodocumentopostulacion_audit OWNER TO postgres;

--
-- TOC entry 827 (class 1259 OID 88742)
-- Dependencies: 825 11
-- Name: tipodocumentopostulacion_idtipodocumentopostulacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentopostulacion_idtipodocumentopostulacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentopostulacion_idtipodocumentopostulacion_seq OWNER TO postgres;

--
-- TOC entry 10561 (class 0 OID 0)
-- Dependencies: 827
-- Name: tipodocumentopostulacion_idtipodocumentopostulacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentopostulacion_idtipodocumentopostulacion_seq OWNED BY tipodocumentopostulacion.idtipodocumentopostulacion;


--
-- TOC entry 828 (class 1259 OID 88744)
-- Dependencies: 11
-- Name: tipodocumentotitularidadbien; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipodocumentotitularidadbien (
    idtipodocumentotitularidadbien integer NOT NULL,
    descripcion character varying(100)
);


ALTER TABLE public.tipodocumentotitularidadbien OWNER TO postgres;

--
-- TOC entry 10562 (class 0 OID 0)
-- Dependencies: 828
-- Name: TABLE tipodocumentotitularidadbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumentotitularidadbien IS 'Tabla de tipo de docmento de titularidad del bien';


--
-- TOC entry 10563 (class 0 OID 0)
-- Dependencies: 828
-- Name: COLUMN tipodocumentotitularidadbien.idtipodocumentotitularidadbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentotitularidadbien.idtipodocumentotitularidadbien IS 'Identificador unico del tipo de documento de titularidad del bien';


--
-- TOC entry 10564 (class 0 OID 0)
-- Dependencies: 828
-- Name: COLUMN tipodocumentotitularidadbien.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumentotitularidadbien.descripcion IS 'Descripcion del tipo de documento de titularidad del bien';


--
-- TOC entry 829 (class 1259 OID 88747)
-- Dependencies: 828 11
-- Name: tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq OWNER TO postgres;

--
-- TOC entry 10565 (class 0 OID 0)
-- Dependencies: 829
-- Name: tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq OWNED BY tipodocumentotitularidadbien.idtipodocumentotitularidadbien;


--
-- TOC entry 830 (class 1259 OID 88749)
-- Dependencies: 11
-- Name: tipoedad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoedad (
    idtipoedad integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoedad OWNER TO postgres;

--
-- TOC entry 10566 (class 0 OID 0)
-- Dependencies: 830
-- Name: TABLE tipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoedad IS 'Tabla del tipo de edad';


--
-- TOC entry 10567 (class 0 OID 0)
-- Dependencies: 830
-- Name: COLUMN tipoedad.idtipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad.idtipoedad IS 'Identificador unico del tipo de edad';


--
-- TOC entry 10568 (class 0 OID 0)
-- Dependencies: 830
-- Name: COLUMN tipoedad.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad.descripcion IS 'Descripcion del tipo edad';


--
-- TOC entry 10569 (class 0 OID 0)
-- Dependencies: 830
-- Name: COLUMN tipoedad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 831 (class 1259 OID 88752)
-- Dependencies: 11
-- Name: tipoedad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoedad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoedad bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoedad_audit OWNER TO postgres;

--
-- TOC entry 10570 (class 0 OID 0)
-- Dependencies: 831
-- Name: TABLE tipoedad_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoedad_audit IS 'Tipos de edad';


--
-- TOC entry 10571 (class 0 OID 0)
-- Dependencies: 831
-- Name: COLUMN tipoedad_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10572 (class 0 OID 0)
-- Dependencies: 831
-- Name: COLUMN tipoedad_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo de edad';


--
-- TOC entry 10573 (class 0 OID 0)
-- Dependencies: 831
-- Name: COLUMN tipoedad_audit.idtipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad_audit.idtipoedad IS 'Identificador unico del tipo de edad';


--
-- TOC entry 10574 (class 0 OID 0)
-- Dependencies: 831
-- Name: COLUMN tipoedad_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad_audit.descripcion IS 'Descripcion del tipo edad';


--
-- TOC entry 10575 (class 0 OID 0)
-- Dependencies: 831
-- Name: COLUMN tipoedad_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoedad_audit.usuario IS 'Usuario que hace la actualizacion';


--
-- TOC entry 832 (class 1259 OID 88755)
-- Dependencies: 830 11
-- Name: tipoedad_idtipoedad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoedad_idtipoedad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoedad_idtipoedad_seq OWNER TO postgres;

--
-- TOC entry 10576 (class 0 OID 0)
-- Dependencies: 832
-- Name: tipoedad_idtipoedad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoedad_idtipoedad_seq OWNED BY tipoedad.idtipoedad;


--
-- TOC entry 833 (class 1259 OID 88757)
-- Dependencies: 11
-- Name: tipoestadonotificacioncorreo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoestadonotificacioncorreo (
    idtipoestadonotificacioncorreo integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoestadonotificacioncorreo OWNER TO postgres;

--
-- TOC entry 10577 (class 0 OID 0)
-- Dependencies: 833
-- Name: COLUMN tipoestadonotificacioncorreo.idtipoestadonotificacioncorreo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadonotificacioncorreo.idtipoestadonotificacioncorreo IS 'Identificador Unico para el tipo de notificacion.';


--
-- TOC entry 10578 (class 0 OID 0)
-- Dependencies: 833
-- Name: COLUMN tipoestadonotificacioncorreo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadonotificacioncorreo.descripcion IS 'Descripcion';


--
-- TOC entry 10579 (class 0 OID 0)
-- Dependencies: 833
-- Name: COLUMN tipoestadonotificacioncorreo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadonotificacioncorreo.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 834 (class 1259 OID 88760)
-- Dependencies: 11
-- Name: tipoestadonotificacioncorreo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoestadonotificacioncorreo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoestadonotificacioncorreo bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoestadonotificacioncorreo_audit OWNER TO postgres;

--
-- TOC entry 835 (class 1259 OID 88763)
-- Dependencies: 833 11
-- Name: tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq OWNER TO postgres;

--
-- TOC entry 10580 (class 0 OID 0)
-- Dependencies: 835
-- Name: tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq OWNED BY tipoestadonotificacioncorreo.idtipoestadonotificacioncorreo;


--
-- TOC entry 836 (class 1259 OID 88765)
-- Dependencies: 7437 11
-- Name: tipoestadopersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoestadopersona (
    idtipoestadopersona character varying(60) NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15),
    idtipopersona integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.tipoestadopersona OWNER TO postgres;

--
-- TOC entry 10581 (class 0 OID 0)
-- Dependencies: 836
-- Name: TABLE tipoestadopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoestadopersona IS 'Tabla que especifica los tipos de estado de personas.';


--
-- TOC entry 10582 (class 0 OID 0)
-- Dependencies: 836
-- Name: COLUMN tipoestadopersona.idtipoestadopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadopersona.idtipoestadopersona IS 'Identificador del tipo de estado de persona';


--
-- TOC entry 10583 (class 0 OID 0)
-- Dependencies: 836
-- Name: COLUMN tipoestadopersona.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadopersona.descripcion IS 'Descripcion del tipo de estado de persona';


--
-- TOC entry 10584 (class 0 OID 0)
-- Dependencies: 836
-- Name: COLUMN tipoestadopersona.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoestadopersona.idtipopersona IS 'Tipo de persona';


--
-- TOC entry 837 (class 1259 OID 88769)
-- Dependencies: 11
-- Name: tipoestadopersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoestadopersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoestadopersona character varying(100),
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15),
    idtipopersona integer
);


ALTER TABLE public.tipoestadopersona_audit OWNER TO postgres;

--
-- TOC entry 838 (class 1259 OID 88772)
-- Dependencies: 11
-- Name: tipofecha; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipofecha (
    idtipofecha integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipofecha OWNER TO postgres;

--
-- TOC entry 10585 (class 0 OID 0)
-- Dependencies: 838
-- Name: TABLE tipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipofecha IS 'Tipos de Fecha.';


--
-- TOC entry 10586 (class 0 OID 0)
-- Dependencies: 838
-- Name: COLUMN tipofecha.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha.idtipofecha IS 'Identificador unico de la Fecha.';


--
-- TOC entry 10587 (class 0 OID 0)
-- Dependencies: 838
-- Name: COLUMN tipofecha.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha.descripcion IS 'Descripcion de la Fecha.';


--
-- TOC entry 10588 (class 0 OID 0)
-- Dependencies: 838
-- Name: COLUMN tipofecha.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 839 (class 1259 OID 88775)
-- Dependencies: 11
-- Name: tipofecha_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipofecha_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipofecha bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipofecha_audit OWNER TO postgres;

--
-- TOC entry 10589 (class 0 OID 0)
-- Dependencies: 839
-- Name: TABLE tipofecha_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipofecha_audit IS 'Tipos de fecha';


--
-- TOC entry 10590 (class 0 OID 0)
-- Dependencies: 839
-- Name: COLUMN tipofecha_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10591 (class 0 OID 0)
-- Dependencies: 839
-- Name: COLUMN tipofecha_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo de fecha';


--
-- TOC entry 10592 (class 0 OID 0)
-- Dependencies: 839
-- Name: COLUMN tipofecha_audit.idtipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha_audit.idtipofecha IS 'Identificador unico de la Fecha';


--
-- TOC entry 10593 (class 0 OID 0)
-- Dependencies: 839
-- Name: COLUMN tipofecha_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha_audit.descripcion IS 'Descripcion de la Fecha';


--
-- TOC entry 10594 (class 0 OID 0)
-- Dependencies: 839
-- Name: COLUMN tipofecha_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipofecha_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 840 (class 1259 OID 88778)
-- Dependencies: 838 11
-- Name: tipofecha_idtipofecha_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipofecha_idtipofecha_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipofecha_idtipofecha_seq OWNER TO postgres;

--
-- TOC entry 10595 (class 0 OID 0)
-- Dependencies: 840
-- Name: tipofecha_idtipofecha_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipofecha_idtipofecha_seq OWNED BY tipofecha.idtipofecha;


--
-- TOC entry 841 (class 1259 OID 88780)
-- Dependencies: 11
-- Name: tipofenomenohistorico; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipofenomenohistorico (
    idtipofenomenohistorico integer NOT NULL,
    tipofenomenohistorico character varying(255) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipofenomenohistorico OWNER TO postgres;

--
-- TOC entry 842 (class 1259 OID 88783)
-- Dependencies: 11
-- Name: tipofenomenohistorico_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipofenomenohistorico_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipofenomenohistorico integer NOT NULL,
    tipofenomenohistorico character varying(255),
    usuario character varying(10)
);


ALTER TABLE public.tipofenomenohistorico_audit OWNER TO postgres;

--
-- TOC entry 843 (class 1259 OID 88786)
-- Dependencies: 842 11
-- Name: tipofenomenohistorico_audit_idtipofenomenohistorico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipofenomenohistorico_audit_idtipofenomenohistorico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipofenomenohistorico_audit_idtipofenomenohistorico_seq OWNER TO postgres;

--
-- TOC entry 10596 (class 0 OID 0)
-- Dependencies: 843
-- Name: tipofenomenohistorico_audit_idtipofenomenohistorico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipofenomenohistorico_audit_idtipofenomenohistorico_seq OWNED BY tipofenomenohistorico_audit.idtipofenomenohistorico;


--
-- TOC entry 844 (class 1259 OID 88788)
-- Dependencies: 841 11
-- Name: tipofenomenohistorico_idtipofenomenohistorico_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipofenomenohistorico_idtipofenomenohistorico_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipofenomenohistorico_idtipofenomenohistorico_seq OWNER TO postgres;

--
-- TOC entry 10597 (class 0 OID 0)
-- Dependencies: 844
-- Name: tipofenomenohistorico_idtipofenomenohistorico_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipofenomenohistorico_idtipofenomenohistorico_seq OWNED BY tipofenomenohistorico.idtipofenomenohistorico;


--
-- TOC entry 845 (class 1259 OID 88790)
-- Dependencies: 11
-- Name: tipohechoversion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipohechoversion (
    idtipohechoversion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    idorigenhechoversion bigint NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipohechoversion OWNER TO postgres;

--
-- TOC entry 10598 (class 0 OID 0)
-- Dependencies: 845
-- Name: TABLE tipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipohechoversion IS 'Tipo del hecho dentro de la version.';


--
-- TOC entry 10599 (class 0 OID 0)
-- Dependencies: 845
-- Name: COLUMN tipohechoversion.idtipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion.idtipohechoversion IS 'Identificador unico del tipo del hecho dentro de la version.';


--
-- TOC entry 10600 (class 0 OID 0)
-- Dependencies: 845
-- Name: COLUMN tipohechoversion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion.descripcion IS 'Descripcion del tipo del hecho dentro de la version.';


--
-- TOC entry 10601 (class 0 OID 0)
-- Dependencies: 845
-- Name: COLUMN tipohechoversion.idorigenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion.idorigenhechoversion IS 'Identificador del origen del hecho de la version.';


--
-- TOC entry 10602 (class 0 OID 0)
-- Dependencies: 845
-- Name: COLUMN tipohechoversion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 846 (class 1259 OID 88793)
-- Dependencies: 11
-- Name: tipohechoversion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipohechoversion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipohechoversion bigint,
    descripcion character varying(100),
    idorigenhechoversion bigint,
    usuario character varying(10)
);


ALTER TABLE public.tipohechoversion_audit OWNER TO postgres;

--
-- TOC entry 10603 (class 0 OID 0)
-- Dependencies: 846
-- Name: TABLE tipohechoversion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipohechoversion_audit IS 'Tipo del hecho dentro de la version';


--
-- TOC entry 10604 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10605 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo del hecho dentro de la version';


--
-- TOC entry 10606 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.idtipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.idtipohechoversion IS 'Identificador unico del tipo del hecho dentro de la version';


--
-- TOC entry 10607 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.descripcion IS 'Descripcion del tipo del hecho dentro de la version';


--
-- TOC entry 10608 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.idorigenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.idorigenhechoversion IS 'Identificador del origen del hecho de la version';


--
-- TOC entry 10609 (class 0 OID 0)
-- Dependencies: 846
-- Name: COLUMN tipohechoversion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohechoversion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 847 (class 1259 OID 88796)
-- Dependencies: 845 11
-- Name: tipohechoversion_idtipohechoversion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipohechoversion_idtipohechoversion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipohechoversion_idtipohechoversion_seq OWNER TO postgres;

--
-- TOC entry 10610 (class 0 OID 0)
-- Dependencies: 847
-- Name: tipohechoversion_idtipohechoversion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipohechoversion_idtipohechoversion_seq OWNED BY tipohechoversion.idtipohechoversion;


--
-- TOC entry 848 (class 1259 OID 88798)
-- Dependencies: 11
-- Name: tipohistorialreclusion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipohistorialreclusion (
    idtipohistorialreclusion integer NOT NULL,
    tipohistorialreclusion character varying(255) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipohistorialreclusion OWNER TO postgres;

--
-- TOC entry 10611 (class 0 OID 0)
-- Dependencies: 848
-- Name: TABLE tipohistorialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipohistorialreclusion IS 'Tipo de historial de reclusion';


--
-- TOC entry 10612 (class 0 OID 0)
-- Dependencies: 848
-- Name: COLUMN tipohistorialreclusion.idtipohistorialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohistorialreclusion.idtipohistorialreclusion IS 'Identificador del Tipo de Historial de Reclusion';


--
-- TOC entry 10613 (class 0 OID 0)
-- Dependencies: 848
-- Name: COLUMN tipohistorialreclusion.tipohistorialreclusion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohistorialreclusion.tipohistorialreclusion IS 'Tipo de historial de recluson';


--
-- TOC entry 10614 (class 0 OID 0)
-- Dependencies: 848
-- Name: COLUMN tipohistorialreclusion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohistorialreclusion.usuario IS 'Usuario que realiza la ultima accion sobre el registro.';


--
-- TOC entry 849 (class 1259 OID 88801)
-- Dependencies: 11
-- Name: tipohistorialreclusion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipohistorialreclusion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipohistorialreclusion integer,
    tipohistorialreclusion character varying(255),
    usuario character varying(10)
);


ALTER TABLE public.tipohistorialreclusion_audit OWNER TO postgres;

--
-- TOC entry 850 (class 1259 OID 88804)
-- Dependencies: 848 11
-- Name: tipohistorialreclusion_idtipohistorialreclusion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipohistorialreclusion_idtipohistorialreclusion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipohistorialreclusion_idtipohistorialreclusion_seq OWNER TO postgres;

--
-- TOC entry 10615 (class 0 OID 0)
-- Dependencies: 850
-- Name: tipohistorialreclusion_idtipohistorialreclusion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipohistorialreclusion_idtipohistorialreclusion_seq OWNED BY tipohistorialreclusion.idtipohistorialreclusion;


--
-- TOC entry 851 (class 1259 OID 88806)
-- Dependencies: 11
-- Name: tipoidentificaciongrupoarmado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoidentificaciongrupoarmado (
    idtipoidentificaciongrupoarmado integer NOT NULL,
    tipoidentificaciongrupoarmado character varying(255) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.tipoidentificaciongrupoarmado OWNER TO postgres;

--
-- TOC entry 852 (class 1259 OID 88809)
-- Dependencies: 11
-- Name: tipoidentificaciongrupoarmado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoidentificaciongrupoarmado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoidentificaciongrupoarmado integer,
    tipoidentificaciongrupoarmado character varying(255) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.tipoidentificaciongrupoarmado_audit OWNER TO postgres;

--
-- TOC entry 853 (class 1259 OID 88812)
-- Dependencies: 851 11
-- Name: tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq OWNER TO postgres;

--
-- TOC entry 10616 (class 0 OID 0)
-- Dependencies: 853
-- Name: tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq OWNED BY tipoidentificaciongrupoarmado.idtipoidentificaciongrupoarmado;


--
-- TOC entry 854 (class 1259 OID 88814)
-- Dependencies: 11
-- Name: tipoinactivopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoinactivopostulado (
    idtipoinactivopostulado integer NOT NULL,
    tipoinactivopostulado character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoinactivopostulado OWNER TO postgres;

--
-- TOC entry 855 (class 1259 OID 88817)
-- Dependencies: 11
-- Name: tipoinactivopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoinactivopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoinactivopostulado integer NOT NULL,
    tipoinactivopostulado character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoinactivopostulado_audit OWNER TO postgres;

--
-- TOC entry 856 (class 1259 OID 88820)
-- Dependencies: 854 11
-- Name: tipoinactivopostulado_idtipoinactivopostulado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoinactivopostulado_idtipoinactivopostulado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoinactivopostulado_idtipoinactivopostulado_seq OWNER TO postgres;

--
-- TOC entry 10617 (class 0 OID 0)
-- Dependencies: 856
-- Name: tipoinactivopostulado_idtipoinactivopostulado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoinactivopostulado_idtipoinactivopostulado_seq OWNED BY tipoinactivopostulado.idtipoinactivopostulado;


--
-- TOC entry 857 (class 1259 OID 88822)
-- Dependencies: 11
-- Name: tipojefe; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipojefe (
    idtipojefe character varying(1) NOT NULL,
    tipojefe character varying(20) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.tipojefe OWNER TO postgres;

--
-- TOC entry 858 (class 1259 OID 88825)
-- Dependencies: 11
-- Name: tipojefe_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipojefe_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipojefe character varying(1),
    tipojefe character varying(20),
    usuario character varying(10)
);


ALTER TABLE public.tipojefe_audit OWNER TO postgres;

--
-- TOC entry 859 (class 1259 OID 88828)
-- Dependencies: 11
-- Name: tipoley; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoley (
    idtipoley integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoley OWNER TO postgres;

--
-- TOC entry 10618 (class 0 OID 0)
-- Dependencies: 859
-- Name: COLUMN tipoley.idtipoley; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoley.idtipoley IS 'Identificador unico del tipo de ley.';


--
-- TOC entry 10619 (class 0 OID 0)
-- Dependencies: 859
-- Name: COLUMN tipoley.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoley.descripcion IS 'Descripcion del tipo de ley.';


--
-- TOC entry 10620 (class 0 OID 0)
-- Dependencies: 859
-- Name: COLUMN tipoley.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoley.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 860 (class 1259 OID 88831)
-- Dependencies: 11
-- Name: tipoley_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoley_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoley bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoley_audit OWNER TO postgres;

--
-- TOC entry 861 (class 1259 OID 88834)
-- Dependencies: 859 11
-- Name: tipoley_idtipoley_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoley_idtipoley_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoley_idtipoley_seq OWNER TO postgres;

--
-- TOC entry 10621 (class 0 OID 0)
-- Dependencies: 861
-- Name: tipoley_idtipoley_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoley_idtipoley_seq OWNED BY tipoley.idtipoley;


--
-- TOC entry 862 (class 1259 OID 88836)
-- Dependencies: 11
-- Name: tipomediopublicacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipomediopublicacion (
    idtipomediopublicacion integer NOT NULL,
    tipomediopublicacion character varying(100) NOT NULL,
    usuario character varying(10)
);


ALTER TABLE public.tipomediopublicacion OWNER TO postgres;

--
-- TOC entry 863 (class 1259 OID 88839)
-- Dependencies: 11
-- Name: tipomediopublicacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipomediopublicacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipomediopublicacion integer,
    tipomediopublicacion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipomediopublicacion_audit OWNER TO postgres;

--
-- TOC entry 864 (class 1259 OID 88842)
-- Dependencies: 862 11
-- Name: tipomediopublicacion_idtipomediopublicacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipomediopublicacion_idtipomediopublicacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipomediopublicacion_idtipomediopublicacion_seq OWNER TO postgres;

--
-- TOC entry 10622 (class 0 OID 0)
-- Dependencies: 864
-- Name: tipomediopublicacion_idtipomediopublicacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipomediopublicacion_idtipomediopublicacion_seq OWNED BY tipomediopublicacion.idtipomediopublicacion;


--
-- TOC entry 865 (class 1259 OID 88844)
-- Dependencies: 11
-- Name: tipomoneda; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipomoneda (
    idtipomoneda integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipomoneda OWNER TO postgres;

--
-- TOC entry 10623 (class 0 OID 0)
-- Dependencies: 865
-- Name: TABLE tipomoneda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipomoneda IS 'Tabla que especifica los tipos de moneda.';


--
-- TOC entry 10624 (class 0 OID 0)
-- Dependencies: 865
-- Name: COLUMN tipomoneda.idtipomoneda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipomoneda.idtipomoneda IS 'Identificador del tipo de moneda';


--
-- TOC entry 10625 (class 0 OID 0)
-- Dependencies: 865
-- Name: COLUMN tipomoneda.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipomoneda.descripcion IS 'Descripcion del tipo de moneda';


--
-- TOC entry 866 (class 1259 OID 88847)
-- Dependencies: 11
-- Name: tipomoneda_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipomoneda_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipomoneda integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipomoneda_audit OWNER TO postgres;

--
-- TOC entry 867 (class 1259 OID 88850)
-- Dependencies: 865 11
-- Name: tipomoneda_idtipomoneda_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipomoneda_idtipomoneda_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipomoneda_idtipomoneda_seq OWNER TO postgres;

--
-- TOC entry 10626 (class 0 OID 0)
-- Dependencies: 867
-- Name: tipomoneda_idtipomoneda_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipomoneda_idtipomoneda_seq OWNED BY tipomoneda.idtipomoneda;


--
-- TOC entry 868 (class 1259 OID 88852)
-- Dependencies: 11
-- Name: tiponivelsisben; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiponivelsisben (
    idtiponivelsisben integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tiponivelsisben OWNER TO postgres;

--
-- TOC entry 10627 (class 0 OID 0)
-- Dependencies: 868
-- Name: TABLE tiponivelsisben; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiponivelsisben IS 'Tabla que especifica los tipos de nivel sisben.';


--
-- TOC entry 10628 (class 0 OID 0)
-- Dependencies: 868
-- Name: COLUMN tiponivelsisben.idtiponivelsisben; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiponivelsisben.idtiponivelsisben IS 'Identificador del tipo de nivel sisben';


--
-- TOC entry 10629 (class 0 OID 0)
-- Dependencies: 868
-- Name: COLUMN tiponivelsisben.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiponivelsisben.descripcion IS 'Descripcion del tipo de nivel sisben';


--
-- TOC entry 869 (class 1259 OID 88855)
-- Dependencies: 11
-- Name: tiponivelsisben_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiponivelsisben_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiponivelsisben integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tiponivelsisben_audit OWNER TO postgres;

--
-- TOC entry 870 (class 1259 OID 88858)
-- Dependencies: 868 11
-- Name: tiponivelsisben_idtiponivelsisben_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiponivelsisben_idtiponivelsisben_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiponivelsisben_idtiponivelsisben_seq OWNER TO postgres;

--
-- TOC entry 10630 (class 0 OID 0)
-- Dependencies: 870
-- Name: tiponivelsisben_idtiponivelsisben_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiponivelsisben_idtiponivelsisben_seq OWNED BY tiponivelsisben.idtiponivelsisben;


--
-- TOC entry 871 (class 1259 OID 88860)
-- Dependencies: 11
-- Name: tipoorigenfuenteinformacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoorigenfuenteinformacion (
    idtipoorigenfuenteinformacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoorigenfuenteinformacion OWNER TO postgres;

--
-- TOC entry 10631 (class 0 OID 0)
-- Dependencies: 871
-- Name: TABLE tipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoorigenfuenteinformacion IS 'Tipos de origen de la fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 10632 (class 0 OID 0)
-- Dependencies: 871
-- Name: COLUMN tipoorigenfuenteinformacion.idtipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion.idtipoorigenfuenteinformacion IS 'Identifcador unico del tipo de origen de la fuente de informacion';


--
-- TOC entry 10633 (class 0 OID 0)
-- Dependencies: 871
-- Name: COLUMN tipoorigenfuenteinformacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion.descripcion IS 'Descripcion del tipo de origen de la fuente de informacion';


--
-- TOC entry 10634 (class 0 OID 0)
-- Dependencies: 871
-- Name: COLUMN tipoorigenfuenteinformacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 872 (class 1259 OID 88863)
-- Dependencies: 11
-- Name: tipoorigenfuenteinformacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoorigenfuenteinformacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoorigenfuenteinformacion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoorigenfuenteinformacion_audit OWNER TO postgres;

--
-- TOC entry 10635 (class 0 OID 0)
-- Dependencies: 872
-- Name: TABLE tipoorigenfuenteinformacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoorigenfuenteinformacion_audit IS 'Tipos de origen de la fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 10636 (class 0 OID 0)
-- Dependencies: 872
-- Name: COLUMN tipoorigenfuenteinformacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10637 (class 0 OID 0)
-- Dependencies: 872
-- Name: COLUMN tipoorigenfuenteinformacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion_audit.fechaactualizacion IS 'Fecha de actualizacion de la fuente de informacion del proceso de justicia y paz';


--
-- TOC entry 10638 (class 0 OID 0)
-- Dependencies: 872
-- Name: COLUMN tipoorigenfuenteinformacion_audit.idtipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion_audit.idtipoorigenfuenteinformacion IS 'Identifcador unico del tipo de origen de la fuente de informacion';


--
-- TOC entry 10639 (class 0 OID 0)
-- Dependencies: 872
-- Name: COLUMN tipoorigenfuenteinformacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion_audit.descripcion IS 'Descripcion del tipo de origen de la fuente de informacion';


--
-- TOC entry 10640 (class 0 OID 0)
-- Dependencies: 872
-- Name: COLUMN tipoorigenfuenteinformacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoorigenfuenteinformacion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 873 (class 1259 OID 88866)
-- Dependencies: 871 11
-- Name: tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq OWNER TO postgres;

--
-- TOC entry 10641 (class 0 OID 0)
-- Dependencies: 873
-- Name: tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq OWNED BY tipoorigenfuenteinformacion.idtipoorigenfuenteinformacion;


--
-- TOC entry 874 (class 1259 OID 88868)
-- Dependencies: 11
-- Name: tipoparticipacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoparticipacion (
    idtipoparticipacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoparticipacion OWNER TO postgres;

--
-- TOC entry 10642 (class 0 OID 0)
-- Dependencies: 874
-- Name: TABLE tipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoparticipacion IS 'Tipo de participacion de un autor en un hecho.';


--
-- TOC entry 10643 (class 0 OID 0)
-- Dependencies: 874
-- Name: COLUMN tipoparticipacion.idtipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion.idtipoparticipacion IS 'Identificador unico de tipo de participacion.';


--
-- TOC entry 10644 (class 0 OID 0)
-- Dependencies: 874
-- Name: COLUMN tipoparticipacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion.descripcion IS 'Descripcion del tipo de participacion.';


--
-- TOC entry 10645 (class 0 OID 0)
-- Dependencies: 874
-- Name: COLUMN tipoparticipacion.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 875 (class 1259 OID 88871)
-- Dependencies: 11
-- Name: tipoparticipacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoparticipacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoparticipacion bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoparticipacion_audit OWNER TO postgres;

--
-- TOC entry 10646 (class 0 OID 0)
-- Dependencies: 875
-- Name: TABLE tipoparticipacion_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoparticipacion_audit IS 'Tipo de participacion de un autor en un hecho';


--
-- TOC entry 10647 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN tipoparticipacion_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10648 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN tipoparticipacion_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo de participacion de un autor en un hecho';


--
-- TOC entry 10649 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN tipoparticipacion_audit.idtipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion_audit.idtipoparticipacion IS 'Identificador unico de tipo de participacion';


--
-- TOC entry 10650 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN tipoparticipacion_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion_audit.descripcion IS 'Descripcion del tipo de participacion';


--
-- TOC entry 10651 (class 0 OID 0)
-- Dependencies: 875
-- Name: COLUMN tipoparticipacion_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoparticipacion_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 876 (class 1259 OID 88874)
-- Dependencies: 874 11
-- Name: tipoparticipacion_idtipoparticipacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoparticipacion_idtipoparticipacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoparticipacion_idtipoparticipacion_seq OWNER TO postgres;

--
-- TOC entry 10652 (class 0 OID 0)
-- Dependencies: 876
-- Name: tipoparticipacion_idtipoparticipacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoparticipacion_idtipoparticipacion_seq OWNED BY tipoparticipacion.idtipoparticipacion;


--
-- TOC entry 877 (class 1259 OID 88876)
-- Dependencies: 11
-- Name: tipoparticipanteaudiencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoparticipanteaudiencia (
    idtipoparticipanteaudiencia integer NOT NULL,
    tipoparticipanteaudiencia character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoparticipanteaudiencia OWNER TO postgres;

--
-- TOC entry 878 (class 1259 OID 88879)
-- Dependencies: 11
-- Name: tipoparticipanteaudiencia_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoparticipanteaudiencia_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoparticipanteaudiencia integer,
    tipoparticipanteaudiencia character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoparticipanteaudiencia_audit OWNER TO postgres;

--
-- TOC entry 879 (class 1259 OID 88882)
-- Dependencies: 877 11
-- Name: tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq OWNER TO postgres;

--
-- TOC entry 10653 (class 0 OID 0)
-- Dependencies: 879
-- Name: tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq OWNED BY tipoparticipanteaudiencia.idtipoparticipanteaudiencia;


SET default_with_oids = true;

--
-- TOC entry 880 (class 1259 OID 88884)
-- Dependencies: 11
-- Name: tipoperfilfotopersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoperfilfotopersona (
    idtipoperfilfotopersona integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoperfilfotopersona OWNER TO postgres;

--
-- TOC entry 10654 (class 0 OID 0)
-- Dependencies: 880
-- Name: COLUMN tipoperfilfotopersona.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoperfilfotopersona.descripcion IS 'Descripcion del tipo de perfil de la foto.';


--
-- TOC entry 10655 (class 0 OID 0)
-- Dependencies: 880
-- Name: COLUMN tipoperfilfotopersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoperfilfotopersona.usuario IS 'Usuario que ingresa el registro en la tabla';


SET default_with_oids = false;

--
-- TOC entry 881 (class 1259 OID 88887)
-- Dependencies: 11
-- Name: tipoperfilfotopersona_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoperfilfotopersona_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoperfilfotopersona integer,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoperfilfotopersona_audit OWNER TO postgres;

--
-- TOC entry 882 (class 1259 OID 88890)
-- Dependencies: 880 11
-- Name: tipoperfilfotopersona_idtipoperfilfotopersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoperfilfotopersona_idtipoperfilfotopersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoperfilfotopersona_idtipoperfilfotopersona_seq OWNER TO postgres;

--
-- TOC entry 10656 (class 0 OID 0)
-- Dependencies: 882
-- Name: tipoperfilfotopersona_idtipoperfilfotopersona_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoperfilfotopersona_idtipoperfilfotopersona_seq OWNED BY tipoperfilfotopersona.idtipoperfilfotopersona;


--
-- TOC entry 883 (class 1259 OID 88892)
-- Dependencies: 11
-- Name: tipopersona_idtipopersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipopersona_idtipopersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.tipopersona_idtipopersona_seq OWNER TO postgres;

--
-- TOC entry 884 (class 1259 OID 88894)
-- Dependencies: 7453 11
-- Name: tipopersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipopersona (
    idtipopersona integer DEFAULT nextval('tipopersona_idtipopersona_seq'::regclass) NOT NULL,
    tipopersona character varying(60) NOT NULL
);


ALTER TABLE public.tipopersona OWNER TO postgres;

--
-- TOC entry 10657 (class 0 OID 0)
-- Dependencies: 884
-- Name: TABLE tipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipopersona IS 'Tabla de tipo de persona que manifiesta hechos y circunstancias, o sobre quien recae ';


--
-- TOC entry 10658 (class 0 OID 0)
-- Dependencies: 884
-- Name: COLUMN tipopersona.idtipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipopersona.idtipopersona IS 'Identificador unico del tipo de persona';


--
-- TOC entry 10659 (class 0 OID 0)
-- Dependencies: 884
-- Name: COLUMN tipopersona.tipopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipopersona.tipopersona IS 'Tipo de persona que manifienta hechos o circunstancias, o sobre quien recaen';


--
-- TOC entry 885 (class 1259 OID 88898)
-- Dependencies: 11
-- Name: tipopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipopostulado (
    idtipopostulado integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipopostulado OWNER TO postgres;

--
-- TOC entry 10660 (class 0 OID 0)
-- Dependencies: 885
-- Name: COLUMN tipopostulado.idtipopostulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipopostulado.idtipopostulado IS 'Identifcador unico para los tipos de postulado.';


--
-- TOC entry 10661 (class 0 OID 0)
-- Dependencies: 885
-- Name: COLUMN tipopostulado.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipopostulado.descripcion IS 'Descripcion de los tipos de postulado.';


--
-- TOC entry 10662 (class 0 OID 0)
-- Dependencies: 885
-- Name: COLUMN tipopostulado.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipopostulado.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 886 (class 1259 OID 88901)
-- Dependencies: 11
-- Name: tipopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipopostulado bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipopostulado_audit OWNER TO postgres;

--
-- TOC entry 887 (class 1259 OID 88904)
-- Dependencies: 885 11
-- Name: tipopostulado_idtipopostulado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipopostulado_idtipopostulado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipopostulado_idtipopostulado_seq OWNER TO postgres;

--
-- TOC entry 10663 (class 0 OID 0)
-- Dependencies: 887
-- Name: tipopostulado_idtipopostulado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipopostulado_idtipopostulado_seq OWNED BY tipopostulado.idtipopostulado;


--
-- TOC entry 888 (class 1259 OID 88906)
-- Dependencies: 11
-- Name: tipopreclusionpostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipopreclusionpostulado (
    idtipopreclusionpostulado integer NOT NULL,
    tipopreclusionpostulado character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipopreclusionpostulado OWNER TO postgres;

--
-- TOC entry 889 (class 1259 OID 88909)
-- Dependencies: 11
-- Name: tipopreclusionpostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipopreclusionpostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipopreclusionpostulado integer NOT NULL,
    tipopreclusionpostulado character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipopreclusionpostulado_audit OWNER TO postgres;

--
-- TOC entry 890 (class 1259 OID 88912)
-- Dependencies: 888 11
-- Name: tipopreclusionpostulado_idtipopreclusionpostulado_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipopreclusionpostulado_idtipopreclusionpostulado_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipopreclusionpostulado_idtipopreclusionpostulado_seq OWNER TO postgres;

--
-- TOC entry 10664 (class 0 OID 0)
-- Dependencies: 890
-- Name: tipopreclusionpostulado_idtipopreclusionpostulado_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipopreclusionpostulado_idtipopreclusionpostulado_seq OWNED BY tipopreclusionpostulado.idtipopreclusionpostulado;


--
-- TOC entry 891 (class 1259 OID 88914)
-- Dependencies: 11
-- Name: tipoprocesojyp; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoprocesojyp (
    idtipoprocesojyp integer NOT NULL,
    tipoprocesojyp character varying(200) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoprocesojyp OWNER TO postgres;

--
-- TOC entry 892 (class 1259 OID 88917)
-- Dependencies: 11
-- Name: tipoprocesojyp_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoprocesojyp_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoprocesojyp integer,
    tipoprocesojyp character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.tipoprocesojyp_audit OWNER TO postgres;

--
-- TOC entry 893 (class 1259 OID 88920)
-- Dependencies: 891 11
-- Name: tipoprocesojyp_idtipoprocesojyp_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoprocesojyp_idtipoprocesojyp_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoprocesojyp_idtipoprocesojyp_seq OWNER TO postgres;

--
-- TOC entry 10665 (class 0 OID 0)
-- Dependencies: 893
-- Name: tipoprocesojyp_idtipoprocesojyp_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoprocesojyp_idtipoprocesojyp_seq OWNED BY tipoprocesojyp.idtipoprocesojyp;


--
-- TOC entry 894 (class 1259 OID 88922)
-- Dependencies: 11
-- Name: tiporangoedad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporangoedad (
    idtiporangoedad integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tiporangoedad OWNER TO postgres;

--
-- TOC entry 10666 (class 0 OID 0)
-- Dependencies: 894
-- Name: TABLE tiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiporangoedad IS 'Tabla de tipo de rango de edad';


--
-- TOC entry 10667 (class 0 OID 0)
-- Dependencies: 894
-- Name: COLUMN tiporangoedad.idtiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad.idtiporangoedad IS 'Identificador unico del tipo de rango de edad';


--
-- TOC entry 10668 (class 0 OID 0)
-- Dependencies: 894
-- Name: COLUMN tiporangoedad.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad.descripcion IS 'Descripcion del rango de edad';


--
-- TOC entry 10669 (class 0 OID 0)
-- Dependencies: 894
-- Name: COLUMN tiporangoedad.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad.usuario IS 'Usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 895 (class 1259 OID 88925)
-- Dependencies: 11
-- Name: tiporangoedad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporangoedad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiporangoedad bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tiporangoedad_audit OWNER TO postgres;

--
-- TOC entry 10670 (class 0 OID 0)
-- Dependencies: 895
-- Name: TABLE tiporangoedad_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiporangoedad_audit IS 'Tabla de tipo de rango de edad';


--
-- TOC entry 10671 (class 0 OID 0)
-- Dependencies: 895
-- Name: COLUMN tiporangoedad_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10672 (class 0 OID 0)
-- Dependencies: 895
-- Name: COLUMN tiporangoedad_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad_audit.fechaactualizacion IS 'Fecha de actualizacion de el tipo de rango de edad';


--
-- TOC entry 10673 (class 0 OID 0)
-- Dependencies: 895
-- Name: COLUMN tiporangoedad_audit.idtiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad_audit.idtiporangoedad IS 'Identificador unico del tipo de rango de edad';


--
-- TOC entry 10674 (class 0 OID 0)
-- Dependencies: 895
-- Name: COLUMN tiporangoedad_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad_audit.descripcion IS 'Descripcion del rango de edad';


--
-- TOC entry 10675 (class 0 OID 0)
-- Dependencies: 895
-- Name: COLUMN tiporangoedad_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporangoedad_audit.usuario IS 'Identificacion del Usuario que realiza la actualizacion';


--
-- TOC entry 896 (class 1259 OID 88928)
-- Dependencies: 894 11
-- Name: tiporangoedad_idtiporangoedad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiporangoedad_idtiporangoedad_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiporangoedad_idtiporangoedad_seq OWNER TO postgres;

--
-- TOC entry 10676 (class 0 OID 0)
-- Dependencies: 896
-- Name: tiporangoedad_idtiporangoedad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiporangoedad_idtiporangoedad_seq OWNED BY tiporangoedad.idtiporangoedad;


--
-- TOC entry 897 (class 1259 OID 88930)
-- Dependencies: 11
-- Name: tiporelacionevento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporelacionevento (
    idtiporelacionevento integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tiporelacionevento OWNER TO postgres;

--
-- TOC entry 10677 (class 0 OID 0)
-- Dependencies: 897
-- Name: TABLE tiporelacionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiporelacionevento IS 'Tipos de relacin de un evento';


--
-- TOC entry 10678 (class 0 OID 0)
-- Dependencies: 897
-- Name: COLUMN tiporelacionevento.idtiporelacionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionevento.idtiporelacionevento IS 'Identifcador unico del tipo de relacion del evento.';


--
-- TOC entry 10679 (class 0 OID 0)
-- Dependencies: 897
-- Name: COLUMN tiporelacionevento.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionevento.descripcion IS 'Descripcion del tipo de relacion del evento.';


--
-- TOC entry 10680 (class 0 OID 0)
-- Dependencies: 897
-- Name: COLUMN tiporelacionevento.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionevento.usuario IS 'Usuario que realiza la actualizacioin.';


--
-- TOC entry 898 (class 1259 OID 88933)
-- Dependencies: 11
-- Name: tiporelacionevento_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporelacionevento_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiporelacionevento bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tiporelacionevento_audit OWNER TO postgres;

--
-- TOC entry 899 (class 1259 OID 88936)
-- Dependencies: 897 11
-- Name: tiporelacionevento_idtiporelacionevento_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiporelacionevento_idtiporelacionevento_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiporelacionevento_idtiporelacionevento_seq OWNER TO postgres;

--
-- TOC entry 10681 (class 0 OID 0)
-- Dependencies: 899
-- Name: tiporelacionevento_idtiporelacionevento_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiporelacionevento_idtiporelacionevento_seq OWNED BY tiporelacionevento.idtiporelacionevento;


--
-- TOC entry 900 (class 1259 OID 88938)
-- Dependencies: 11
-- Name: tiporelacionparentesco_idtiporelacionparentesco_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiporelacionparentesco_idtiporelacionparentesco_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.tiporelacionparentesco_idtiporelacionparentesco_seq OWNER TO postgres;

--
-- TOC entry 901 (class 1259 OID 88940)
-- Dependencies: 7459 7460 11
-- Name: tiporelacionparentesco; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporelacionparentesco (
    idtiporelacionparentesco integer DEFAULT nextval('tiporelacionparentesco_idtiporelacionparentesco_seq'::regclass) NOT NULL,
    tiporelacionparentesco character varying(60) NOT NULL,
    parentescoinverso character varying(60),
    usuario character varying(10) DEFAULT 'willbelt'::character varying NOT NULL
);


ALTER TABLE public.tiporelacionparentesco OWNER TO postgres;

--
-- TOC entry 10682 (class 0 OID 0)
-- Dependencies: 901
-- Name: TABLE tiporelacionparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiporelacionparentesco IS 'Cuadro tipo de relacion de parentesco';


--
-- TOC entry 10683 (class 0 OID 0)
-- Dependencies: 901
-- Name: COLUMN tiporelacionparentesco.idtiporelacionparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionparentesco.idtiporelacionparentesco IS 'Identificador unico del tipo de relacion de parentesco';


--
-- TOC entry 10684 (class 0 OID 0)
-- Dependencies: 901
-- Name: COLUMN tiporelacionparentesco.tiporelacionparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionparentesco.tiporelacionparentesco IS 'Tipo de relacion de parentesco';


--
-- TOC entry 902 (class 1259 OID 88945)
-- Dependencies: 11
-- Name: tiporelacionpersonajuridicacolectividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporelacionpersonajuridicacolectividad (
    idtiporelacionpersonajuridicacolectividad integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tiporelacionpersonajuridicacolectividad OWNER TO postgres;

--
-- TOC entry 10685 (class 0 OID 0)
-- Dependencies: 902
-- Name: TABLE tiporelacionpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiporelacionpersonajuridicacolectividad IS 'Tabla que especifica los tipo de relacion de la persona juridica o colectividad con la persona natural.';


--
-- TOC entry 10686 (class 0 OID 0)
-- Dependencies: 902
-- Name: COLUMN tiporelacionpersonajuridicacolectividad.idtiporelacionpersonajuridicacolectividad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionpersonajuridicacolectividad.idtiporelacionpersonajuridicacolectividad IS 'Identificador del de relacion de la persona juridica o colectividad con la persona natural';


--
-- TOC entry 10687 (class 0 OID 0)
-- Dependencies: 902
-- Name: COLUMN tiporelacionpersonajuridicacolectividad.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiporelacionpersonajuridicacolectividad.descripcion IS 'Descripcion del de relacion de la persona juridica o colectividad con la persona natural';


--
-- TOC entry 903 (class 1259 OID 88948)
-- Dependencies: 902 11
-- Name: tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq OWNER TO postgres;

--
-- TOC entry 10688 (class 0 OID 0)
-- Dependencies: 903
-- Name: tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq OWNED BY tiporelacionpersonajuridicacolectividad.idtiporelacionpersonajuridicacolectividad;


--
-- TOC entry 904 (class 1259 OID 88950)
-- Dependencies: 11
-- Name: tiporelacionpersonajuridicacolectividad_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiporelacionpersonajuridicacolectividad_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiporelacionpersonajuridicacolectividad integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tiporelacionpersonajuridicacolectividad_audit OWNER TO postgres;

--
-- TOC entry 905 (class 1259 OID 88953)
-- Dependencies: 11
-- Name: tiposectortrabajo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiposectortrabajo (
    idtiposectortrabajo integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tiposectortrabajo OWNER TO postgres;

--
-- TOC entry 10689 (class 0 OID 0)
-- Dependencies: 905
-- Name: TABLE tiposectortrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiposectortrabajo IS 'Tabla que especifica los tipos de sectores de trabajo.';


--
-- TOC entry 10690 (class 0 OID 0)
-- Dependencies: 905
-- Name: COLUMN tiposectortrabajo.idtiposectortrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiposectortrabajo.idtiposectortrabajo IS 'Identificador del tipo de sector de trabajo';


--
-- TOC entry 10691 (class 0 OID 0)
-- Dependencies: 905
-- Name: COLUMN tiposectortrabajo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiposectortrabajo.descripcion IS 'Descripcion del tipo de sector de trabajo';


--
-- TOC entry 906 (class 1259 OID 88956)
-- Dependencies: 11
-- Name: tiposectortrabajo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiposectortrabajo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiposectortrabajo integer,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tiposectortrabajo_audit OWNER TO postgres;

--
-- TOC entry 907 (class 1259 OID 88959)
-- Dependencies: 905 11
-- Name: tiposectortrabajo_idtiposectortrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiposectortrabajo_idtiposectortrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiposectortrabajo_idtiposectortrabajo_seq OWNER TO postgres;

--
-- TOC entry 10692 (class 0 OID 0)
-- Dependencies: 907
-- Name: tiposectortrabajo_idtiposectortrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiposectortrabajo_idtiposectortrabajo_seq OWNED BY tiposectortrabajo.idtiposectortrabajo;


--
-- TOC entry 908 (class 1259 OID 88961)
-- Dependencies: 11
-- Name: tiposubclasificacionpersonajuridica; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiposubclasificacionpersonajuridica (
    idtiposubclasificacionpersonajuridica integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    idtipoclasificacionpersonajuridica integer NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tiposubclasificacionpersonajuridica OWNER TO postgres;

--
-- TOC entry 10693 (class 0 OID 0)
-- Dependencies: 908
-- Name: TABLE tiposubclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tiposubclasificacionpersonajuridica IS 'Tabla que especifica los tipos de clasificacion de la persona juridica.';


--
-- TOC entry 10694 (class 0 OID 0)
-- Dependencies: 908
-- Name: COLUMN tiposubclasificacionpersonajuridica.idtiposubclasificacionpersonajuridica; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiposubclasificacionpersonajuridica.idtiposubclasificacionpersonajuridica IS 'Identificador del tipo de clasificacion de la persona juridica';


--
-- TOC entry 10695 (class 0 OID 0)
-- Dependencies: 908
-- Name: COLUMN tiposubclasificacionpersonajuridica.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tiposubclasificacionpersonajuridica.descripcion IS 'Descripcion del tipo de clasificacion de la persona juridica';


--
-- TOC entry 909 (class 1259 OID 88964)
-- Dependencies: 908 11
-- Name: tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq OWNER TO postgres;

--
-- TOC entry 10696 (class 0 OID 0)
-- Dependencies: 909
-- Name: tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq OWNED BY tiposubclasificacionpersonajuridica.idtiposubclasificacionpersonajuridica;


--
-- TOC entry 910 (class 1259 OID 88966)
-- Dependencies: 11
-- Name: tiposubclasificacionpersonajuridica_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tiposubclasificacionpersonajuridica_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtiposubclasificacionpersonajuridica integer,
    descripcion character varying(100),
    idtipoclasificacionpersonajuridica integer NOT NULL,
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tiposubclasificacionpersonajuridica_audit OWNER TO postgres;

--
-- TOC entry 911 (class 1259 OID 88969)
-- Dependencies: 11
-- Name: tipoterminacionprocesopostulado; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoterminacionprocesopostulado (
    idtipoterminacion integer NOT NULL,
    tipoterminacion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoterminacionprocesopostulado OWNER TO postgres;

--
-- TOC entry 912 (class 1259 OID 88972)
-- Dependencies: 11
-- Name: tipoterminacionprocesopostulado_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoterminacionprocesopostulado_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoterminacion integer,
    tipoterminacion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoterminacionprocesopostulado_audit OWNER TO postgres;

--
-- TOC entry 913 (class 1259 OID 88975)
-- Dependencies: 911 11
-- Name: tipoterminacionprocesopostulado_idtipoterminacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoterminacionprocesopostulado_idtipoterminacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoterminacionprocesopostulado_idtipoterminacion_seq OWNER TO postgres;

--
-- TOC entry 10697 (class 0 OID 0)
-- Dependencies: 913
-- Name: tipoterminacionprocesopostulado_idtipoterminacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoterminacionprocesopostulado_idtipoterminacion_seq OWNED BY tipoterminacionprocesopostulado.idtipoterminacion;


--
-- TOC entry 914 (class 1259 OID 88977)
-- Dependencies: 11
-- Name: tipotitular; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipotitular (
    idtipotitular integer NOT NULL,
    descripcion character varying(100)
);


ALTER TABLE public.tipotitular OWNER TO postgres;

--
-- TOC entry 10698 (class 0 OID 0)
-- Dependencies: 914
-- Name: TABLE tipotitular; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipotitular IS 'Tipo de titular de un bien';


--
-- TOC entry 10699 (class 0 OID 0)
-- Dependencies: 914
-- Name: COLUMN tipotitular.idtipotitular; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotitular.idtipotitular IS 'Identificador unico del tipo de titular de un bien';


--
-- TOC entry 10700 (class 0 OID 0)
-- Dependencies: 914
-- Name: COLUMN tipotitular.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotitular.descripcion IS 'Descripcion del tipo de titular de un bien';


--
-- TOC entry 915 (class 1259 OID 88980)
-- Dependencies: 914 11
-- Name: tipotitular_idtipotitular_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipotitular_idtipotitular_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipotitular_idtipotitular_seq OWNER TO postgres;

--
-- TOC entry 10701 (class 0 OID 0)
-- Dependencies: 915
-- Name: tipotitular_idtipotitular_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipotitular_idtipotitular_seq OWNED BY tipotitular.idtipotitular;


--
-- TOC entry 916 (class 1259 OID 88982)
-- Dependencies: 11
-- Name: tipotrabajo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipotrabajo (
    idtipotrabajo integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipotrabajo OWNER TO postgres;

--
-- TOC entry 10702 (class 0 OID 0)
-- Dependencies: 916
-- Name: TABLE tipotrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipotrabajo IS 'Tabla que especifica los tipos de trabajo de personas.';


--
-- TOC entry 10703 (class 0 OID 0)
-- Dependencies: 916
-- Name: COLUMN tipotrabajo.idtipotrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotrabajo.idtipotrabajo IS 'Identificador del tipo de trabajo de persona';


--
-- TOC entry 10704 (class 0 OID 0)
-- Dependencies: 916
-- Name: COLUMN tipotrabajo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotrabajo.descripcion IS 'Descripcion del tipo de trabajo de persona';


--
-- TOC entry 917 (class 1259 OID 88985)
-- Dependencies: 11
-- Name: tipotrabajo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipotrabajo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipotrabajo integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipotrabajo_audit OWNER TO postgres;

--
-- TOC entry 918 (class 1259 OID 88988)
-- Dependencies: 917 11
-- Name: tipotrabajo_audit_idtipotrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipotrabajo_audit_idtipotrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipotrabajo_audit_idtipotrabajo_seq OWNER TO postgres;

--
-- TOC entry 10705 (class 0 OID 0)
-- Dependencies: 918
-- Name: tipotrabajo_audit_idtipotrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipotrabajo_audit_idtipotrabajo_seq OWNED BY tipotrabajo_audit.idtipotrabajo;


--
-- TOC entry 919 (class 1259 OID 88990)
-- Dependencies: 916 11
-- Name: tipotrabajo_idtipotrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipotrabajo_idtipotrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipotrabajo_idtipotrabajo_seq OWNER TO postgres;

--
-- TOC entry 10706 (class 0 OID 0)
-- Dependencies: 919
-- Name: tipotrabajo_idtipotrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipotrabajo_idtipotrabajo_seq OWNED BY tipotrabajo.idtipotrabajo;


--
-- TOC entry 920 (class 1259 OID 88992)
-- Dependencies: 11
-- Name: tipoubicacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoubicacion (
    idtipoubicacion integer NOT NULL,
    descripcion character varying(100) NOT NULL,
    usuario character varying(10) NOT NULL,
    ip character varying(15)
);


ALTER TABLE public.tipoubicacion OWNER TO postgres;

--
-- TOC entry 10707 (class 0 OID 0)
-- Dependencies: 920
-- Name: TABLE tipoubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoubicacion IS 'Tabla que especifica los tipos de ubicacion de personas.';


--
-- TOC entry 10708 (class 0 OID 0)
-- Dependencies: 920
-- Name: COLUMN tipoubicacion.idtipoubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacion.idtipoubicacion IS 'Identificador del tipo de ubicacion de persona';


--
-- TOC entry 10709 (class 0 OID 0)
-- Dependencies: 920
-- Name: COLUMN tipoubicacion.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacion.descripcion IS 'Descripcion del tipo de ubicacion de persona';


--
-- TOC entry 921 (class 1259 OID 88995)
-- Dependencies: 11
-- Name: tipoubicacion_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoubicacion_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoubicacion integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10),
    ip character varying(15)
);


ALTER TABLE public.tipoubicacion_audit OWNER TO postgres;

--
-- TOC entry 922 (class 1259 OID 88998)
-- Dependencies: 921 11
-- Name: tipoubicacion_audit_idtipoubicacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoubicacion_audit_idtipoubicacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoubicacion_audit_idtipoubicacion_seq OWNER TO postgres;

--
-- TOC entry 10710 (class 0 OID 0)
-- Dependencies: 922
-- Name: tipoubicacion_audit_idtipoubicacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoubicacion_audit_idtipoubicacion_seq OWNED BY tipoubicacion_audit.idtipoubicacion;


--
-- TOC entry 923 (class 1259 OID 89000)
-- Dependencies: 920 11
-- Name: tipoubicacion_idtipoubicacion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoubicacion_idtipoubicacion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoubicacion_idtipoubicacion_seq OWNER TO postgres;

--
-- TOC entry 10711 (class 0 OID 0)
-- Dependencies: 923
-- Name: tipoubicacion_idtipoubicacion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoubicacion_idtipoubicacion_seq OWNED BY tipoubicacion.idtipoubicacion;


--
-- TOC entry 924 (class 1259 OID 89002)
-- Dependencies: 11
-- Name: tipoubicacioncuerpo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoubicacioncuerpo (
    idtipoubicacioncuerpo integer NOT NULL,
    descripcion character varying(100),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.tipoubicacioncuerpo OWNER TO postgres;

--
-- TOC entry 10712 (class 0 OID 0)
-- Dependencies: 924
-- Name: TABLE tipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoubicacioncuerpo IS 'Tabla del tipo de ubicacion del cuerpo';


--
-- TOC entry 10713 (class 0 OID 0)
-- Dependencies: 924
-- Name: COLUMN tipoubicacioncuerpo.idtipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo.idtipoubicacioncuerpo IS 'Identificador unico de la ubicacion del cuerpo';


--
-- TOC entry 10714 (class 0 OID 0)
-- Dependencies: 924
-- Name: COLUMN tipoubicacioncuerpo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo.descripcion IS 'Descripcion del lugar de ubicacion del cuerpo';


--
-- TOC entry 10715 (class 0 OID 0)
-- Dependencies: 924
-- Name: COLUMN tipoubicacioncuerpo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo.usuario IS 'Identificacion del Usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 925 (class 1259 OID 89005)
-- Dependencies: 11
-- Name: tipoubicacioncuerpo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoubicacioncuerpo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoubicacioncuerpo bigint,
    descripcion character varying(100),
    usuario character varying(10)
);


ALTER TABLE public.tipoubicacioncuerpo_audit OWNER TO postgres;

--
-- TOC entry 10716 (class 0 OID 0)
-- Dependencies: 925
-- Name: TABLE tipoubicacioncuerpo_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipoubicacioncuerpo_audit IS 'Tabla del tipo de ubicacion del cuerpo
';


--
-- TOC entry 10717 (class 0 OID 0)
-- Dependencies: 925
-- Name: COLUMN tipoubicacioncuerpo_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10718 (class 0 OID 0)
-- Dependencies: 925
-- Name: COLUMN tipoubicacioncuerpo_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo_audit.fechaactualizacion IS 'Fecha de actualizacion del tipo de ubicacion del cuerpo';


--
-- TOC entry 10719 (class 0 OID 0)
-- Dependencies: 925
-- Name: COLUMN tipoubicacioncuerpo_audit.idtipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo_audit.idtipoubicacioncuerpo IS 'Identificador unico de la ubicacion del cuerpo';


--
-- TOC entry 10720 (class 0 OID 0)
-- Dependencies: 925
-- Name: COLUMN tipoubicacioncuerpo_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo_audit.descripcion IS 'Descripcion del lugar de ubicacion del cuerpo';


--
-- TOC entry 10721 (class 0 OID 0)
-- Dependencies: 925
-- Name: COLUMN tipoubicacioncuerpo_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipoubicacioncuerpo_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 926 (class 1259 OID 89008)
-- Dependencies: 924 11
-- Name: tipoubicacioncuerpo_idtipoubicacioncuerpo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipoubicacioncuerpo_idtipoubicacioncuerpo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tipoubicacioncuerpo_idtipoubicacioncuerpo_seq OWNER TO postgres;

--
-- TOC entry 10722 (class 0 OID 0)
-- Dependencies: 926
-- Name: tipoubicacioncuerpo_idtipoubicacioncuerpo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipoubicacioncuerpo_idtipoubicacioncuerpo_seq OWNED BY tipoubicacioncuerpo.idtipoubicacioncuerpo;


--
-- TOC entry 927 (class 1259 OID 89010)
-- Dependencies: 11
-- Name: titularbien; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE titularbien (
    idpersona bigint NOT NULL,
    idbien bigint NOT NULL,
    idtipotitular bigint NOT NULL,
    idtipodocumentotitularidadbien bigint,
    numerodocumetotitularidad bigint,
    fechadocumtotitularidad date,
    idpaisdocumentotitularidad bigint,
    iddepartamentodocumentotitularidad bigint,
    idmunicipiodocumentotitularidad bigint,
    descripciondocumentotitularidad character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.titularbien OWNER TO postgres;

--
-- TOC entry 10723 (class 0 OID 0)
-- Dependencies: 927
-- Name: TABLE titularbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE titularbien IS 'Identificacion del titular de un bien';


--
-- TOC entry 10724 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idpersona IS 'Identificador unico de persona';


--
-- TOC entry 10725 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idbien IS 'Identificador unico de un bien';


--
-- TOC entry 10726 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idtipotitular; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idtipotitular IS 'Identificador unico del tipo de titular';


--
-- TOC entry 10727 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idtipodocumentotitularidadbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idtipodocumentotitularidadbien IS 'Identificador unico del tipo de documento de titularidad del bien';


--
-- TOC entry 10728 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.numerodocumetotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.numerodocumetotitularidad IS 'Numero del documento de titularidad';


--
-- TOC entry 10729 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.fechadocumtotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.fechadocumtotitularidad IS 'Fecha del documento de titularidad';


--
-- TOC entry 10730 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idpaisdocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idpaisdocumentotitularidad IS 'Identificador unico del pais del documento de titularidad';


--
-- TOC entry 10731 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.iddepartamentodocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.iddepartamentodocumentotitularidad IS 'Identificador unico del departamento (lugar) del documento de titularidad';


--
-- TOC entry 10732 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.idmunicipiodocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.idmunicipiodocumentotitularidad IS 'Identificador unico del municipio del documento de titularidad';


--
-- TOC entry 10733 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.descripciondocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.descripciondocumentotitularidad IS 'Descripcion del documento de titularidad';


--
-- TOC entry 10734 (class 0 OID 0)
-- Dependencies: 927
-- Name: COLUMN titularbien.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien.usuario IS 'Usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 928 (class 1259 OID 89013)
-- Dependencies: 11
-- Name: titularbien_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE titularbien_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idpersona bigint NOT NULL,
    idbien bigint NOT NULL,
    idtipotitular bigint NOT NULL,
    idtipodocumentotitularidadbien bigint,
    numerodocumetotitularidad bigint,
    fechadocumtotitularidad date,
    idpaisdocumentotitularidad bigint,
    iddepartamentodocumentotitularidad bigint,
    idmunicipiodocumentotitularidad bigint,
    descripciondocumentotitularidad character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.titularbien_audit OWNER TO postgres;

--
-- TOC entry 10735 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10736 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.fechaactualizacion IS 'Fecha de actualizacion del titular del bien';


--
-- TOC entry 10737 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idpersona IS 'Identificador unico de persona';


--
-- TOC entry 10738 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idbien IS 'Identificador unico de un bien';


--
-- TOC entry 10739 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idtipotitular; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idtipotitular IS 'Identificador unico del tipo de titular';


--
-- TOC entry 10740 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idtipodocumentotitularidadbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idtipodocumentotitularidadbien IS 'Identificador unico del tipo de documento de titularidad del bien';


--
-- TOC entry 10741 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.numerodocumetotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.numerodocumetotitularidad IS 'Numero del documento de titularidad';


--
-- TOC entry 10742 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.fechadocumtotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.fechadocumtotitularidad IS 'Fecha del documento de titularidad';


--
-- TOC entry 10743 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idpaisdocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idpaisdocumentotitularidad IS 'Identificador unico del pais del documento de titularidad';


--
-- TOC entry 10744 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.iddepartamentodocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.iddepartamentodocumentotitularidad IS 'Identificador unico del departamento (lugar) del documento de titularidad';


--
-- TOC entry 10745 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.idmunicipiodocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.idmunicipiodocumentotitularidad IS 'Identificador unico del municipio del documento de titularidad';


--
-- TOC entry 10746 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.descripciondocumentotitularidad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.descripciondocumentotitularidad IS 'Descripcion del documento de titularidad';


--
-- TOC entry 10747 (class 0 OID 0)
-- Dependencies: 928
-- Name: COLUMN titularbien_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN titularbien_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 929 (class 1259 OID 89016)
-- Dependencies: 11
-- Name: trabajo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE trabajo (
    idtrabajo integer NOT NULL,
    nombreempresa character varying(200),
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    descripcion text,
    fechainicio date,
    idpersona bigint,
    fechafin date,
    inspeccion character varying(100),
    corregimiento character varying(100),
    vereda character varying(100),
    finca character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    sitio character varying(200),
    usuario character varying(10),
    idtipotrabajo integer,
    cargo character varying(30),
    ip character varying(15)
);


ALTER TABLE public.trabajo OWNER TO postgres;

--
-- TOC entry 10748 (class 0 OID 0)
-- Dependencies: 929
-- Name: TABLE trabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE trabajo IS 'Trabajo de persona';


--
-- TOC entry 10749 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.idtrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.idtrabajo IS 'Identificador unico del trabajo, numero consecutivo';


--
-- TOC entry 10750 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.nombreempresa; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.nombreempresa IS 'Nombre de la empresa donde trabaja';


--
-- TOC entry 10751 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.idpais IS 'Identificador unico del pais donde trabaja';


--
-- TOC entry 10752 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.iddepartamento IS 'Identificador unico del departamento donde trabaja';


--
-- TOC entry 10753 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.idmunicipio IS 'Identificador unico del municipio donde trabaja';


--
-- TOC entry 10754 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.descripcion IS 'Descripcion del lugar donde trabaja';


--
-- TOC entry 10755 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.fechainicio IS 'Fecha de inicio del trabajo';


--
-- TOC entry 10756 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10757 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.fechafin IS 'Fecha de finalizacion del trabajo';


--
-- TOC entry 10758 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.inspeccion IS 'Inspeccion (territorio) del lugar de trabajo';


--
-- TOC entry 10759 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.corregimiento IS 'Corregimiento del lugar de trabajo';


--
-- TOC entry 10760 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.vereda IS 'Vereda del lugar de trabajo';


--
-- TOC entry 10761 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.finca IS 'Finca del lugar de trabajo';


--
-- TOC entry 10762 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.barrio IS 'Barrio del lugar de trabajo';


--
-- TOC entry 10763 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.direccion IS 'Direccion del lugar de trabajo';


--
-- TOC entry 10764 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.sitio IS 'Sitio del lugar de trabajo';


--
-- TOC entry 10765 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.usuario IS 'Identificacion del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10766 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.idtipotrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.idtipotrabajo IS 'Tipo de trabajo de persona';


--
-- TOC entry 10767 (class 0 OID 0)
-- Dependencies: 929
-- Name: COLUMN trabajo.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo.cargo IS 'Cargo de la persona';


--
-- TOC entry 930 (class 1259 OID 89022)
-- Dependencies: 11
-- Name: trabajo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE trabajo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtrabajo bigint NOT NULL,
    nombreempresa character varying(200),
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    descripcion text,
    fechainicio date,
    idpersona bigint,
    fechafin date,
    inspeccion character varying(100),
    corregimiento character varying(100),
    vereda character varying(100),
    finca character varying(100),
    barrio character varying(100),
    direccion character varying(200),
    sitio character varying(200),
    usuario character varying(10),
    idtipotrabajo integer,
    cargo character varying(30),
    ip character varying(15)
);


ALTER TABLE public.trabajo_audit OWNER TO postgres;

--
-- TOC entry 10768 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10769 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.fechaactualizacion IS 'Fecha de actualizacion de la tabla trabajo';


--
-- TOC entry 10770 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.idtrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.idtrabajo IS 'Identificador unico del trabajo, numero consecutivo';


--
-- TOC entry 10771 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.nombreempresa; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.nombreempresa IS 'Nombre de la empresa donde trabaja';


--
-- TOC entry 10772 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.idpais IS 'Identificador unico del pais donde trabaja';


--
-- TOC entry 10773 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.iddepartamento IS 'Identificador unico del departamento donde trabaja';


--
-- TOC entry 10774 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.idmunicipio IS 'Identificador unico del municipio donde trabaja';


--
-- TOC entry 10775 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.descripcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.descripcion IS 'Descripcion del lugar donde trabaja';


--
-- TOC entry 10776 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.fechainicio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.fechainicio IS 'Fecha de inicio del trabajo';


--
-- TOC entry 10777 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.idpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.idpersona IS 'Identificador unico de la persona';


--
-- TOC entry 10778 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.fechafin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.fechafin IS 'Fecha de finalizacion del trabajo';


--
-- TOC entry 10779 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.inspeccion IS 'Inspeccion (territorio) del lugar de trabajo';


--
-- TOC entry 10780 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.corregimiento IS 'Corregimiento del lugar de trabajo';


--
-- TOC entry 10781 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.vereda IS 'Vereda del lugar de trabajo';


--
-- TOC entry 10782 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.finca IS 'Finca del lugar de trabajo';


--
-- TOC entry 10783 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.barrio IS 'Barrio del lugar de trabajo';


--
-- TOC entry 10784 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.direccion IS 'Direccion del lugar de trabajo';


--
-- TOC entry 10785 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.sitio IS 'Sitio del lugar de trabajo';


--
-- TOC entry 10786 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 10787 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.idtipotrabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.idtipotrabajo IS 'Tipo de trabajo de persona';


--
-- TOC entry 10788 (class 0 OID 0)
-- Dependencies: 930
-- Name: COLUMN trabajo_audit.cargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN trabajo_audit.cargo IS 'Cargo de la persona';


--
-- TOC entry 931 (class 1259 OID 89031)
-- Dependencies: 929 11
-- Name: trabajo_idtrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE trabajo_idtrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trabajo_idtrabajo_seq OWNER TO postgres;

--
-- TOC entry 10789 (class 0 OID 0)
-- Dependencies: 931
-- Name: trabajo_idtrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE trabajo_idtrabajo_seq OWNED BY trabajo.idtrabajo;


--
-- TOC entry 932 (class 1259 OID 89033)
-- Dependencies: 11
-- Name: ubicacioncuerpo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ubicacioncuerpo (
    idtipoubicacioncuerpo integer NOT NULL,
    idhecho bigint NOT NULL,
    observacion text,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    corregimiento character varying(100),
    vereda character varying(100),
    direccion character varying(200),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.ubicacioncuerpo OWNER TO postgres;

--
-- TOC entry 10790 (class 0 OID 0)
-- Dependencies: 932
-- Name: TABLE ubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE ubicacioncuerpo IS 'Ubicacion geografica de un cuerpo';


--
-- TOC entry 10791 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.idtipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.idtipoubicacioncuerpo IS 'Identificador unico en la tabla del tipo de ubicacion del cuerpo';


--
-- TOC entry 10792 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10793 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.observacion IS 'Iformacion adicional que permita la localizacion del cuerpo';


--
-- TOC entry 10794 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.idpais IS 'Identificador unico del pais para la ubicacion del cuerpo';


--
-- TOC entry 10795 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.iddepartamento IS 'Identificador unico del departamento para la ubicacion del cuerpo';


--
-- TOC entry 10796 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.idmunicipio IS 'Identificador unico del municipio para la ubicacion del cuerpo';


--
-- TOC entry 10797 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.corregimiento IS 'Identificador unico del corregimiento para la ubicacion del cuerpo';


--
-- TOC entry 10798 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.vereda IS 'Vereda donde se localiza el cuerpo';


--
-- TOC entry 10799 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.direccion IS 'Direccion donde se localiza el cuerpo';


--
-- TOC entry 10800 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.inspeccion IS 'Inspeccion donde se localiza el cuerpo';


--
-- TOC entry 10801 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.finca IS 'Finca donde se localiza el cuerpo';


--
-- TOC entry 10802 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.barrio IS 'Barrio donde se localiza el cuerpo';


--
-- TOC entry 10803 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.sitio IS 'Sitio donde se encuentra el cuerpo';


--
-- TOC entry 10804 (class 0 OID 0)
-- Dependencies: 932
-- Name: COLUMN ubicacioncuerpo.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo.usuario IS 'Identificacion del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 933 (class 1259 OID 89039)
-- Dependencies: 11
-- Name: ubicacioncuerpo_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ubicacioncuerpo_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idtipoubicacioncuerpo bigint,
    idhecho bigint,
    observacion text,
    idpais bigint,
    iddepartamento bigint,
    idmunicipio bigint,
    corregimiento character varying(100),
    vereda character varying(100),
    direccion character varying(200),
    inspeccion character varying(100),
    finca character varying(100),
    barrio character varying(100),
    sitio character varying(200),
    usuario character varying(10)
);


ALTER TABLE public.ubicacioncuerpo_audit OWNER TO postgres;

--
-- TOC entry 10805 (class 0 OID 0)
-- Dependencies: 933
-- Name: TABLE ubicacioncuerpo_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE ubicacioncuerpo_audit IS 'Ubicacion geografica de un cuerpo';


--
-- TOC entry 10806 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10807 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.fechaactualizacion IS 'Fecha de actualizacion de la ubicacion del cuerpo';


--
-- TOC entry 10808 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.idtipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.idtipoubicacioncuerpo IS 'Identificador unico en la tabla del tipo de ubicacion del cuerpo';


--
-- TOC entry 10809 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.idhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.idhecho IS 'Identificador unico del hecho';


--
-- TOC entry 10810 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.observacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.observacion IS 'Iformacion adicional que permita la localizacion del cuerpo';


--
-- TOC entry 10811 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.idpais; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.idpais IS 'Identificador unico del pais para la ubicacion del cuerpo';


--
-- TOC entry 10812 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.iddepartamento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.iddepartamento IS 'Identificador unico del departamento para la ubicacion del cuerpo';


--
-- TOC entry 10813 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.idmunicipio IS 'Identificador unico del municipio para la ubicacion del cuerpo';


--
-- TOC entry 10814 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.corregimiento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.corregimiento IS 'Identificador unico del corregimiento para la ubicacion del cuerpo';


--
-- TOC entry 10815 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.vereda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.vereda IS 'Vereda donde se localiza el cuerpo';


--
-- TOC entry 10816 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.direccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.direccion IS 'Direccion donde se localiza el cuerpo';


--
-- TOC entry 10817 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.inspeccion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.inspeccion IS 'Inspeccion donde se localiza el cuerpo';


--
-- TOC entry 10818 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.finca; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.finca IS 'Finca donde se localiza el cuerpo';


--
-- TOC entry 10819 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.barrio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.barrio IS 'Barrio donde se localiza el cuerpo';


--
-- TOC entry 10820 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.sitio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.sitio IS 'Sitio donde se encuentra el cuerpo';


--
-- TOC entry 10821 (class 0 OID 0)
-- Dependencies: 933
-- Name: COLUMN ubicacioncuerpo_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN ubicacioncuerpo_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 934 (class 1259 OID 89045)
-- Dependencies: 932 11
-- Name: ubicacioncuerpo_idtipoubicacioncuerpo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE ubicacioncuerpo_idtipoubicacioncuerpo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ubicacioncuerpo_idtipoubicacioncuerpo_seq OWNER TO postgres;

--
-- TOC entry 10822 (class 0 OID 0)
-- Dependencies: 934
-- Name: ubicacioncuerpo_idtipoubicacioncuerpo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE ubicacioncuerpo_idtipoubicacioncuerpo_seq OWNED BY ubicacioncuerpo.idtipoubicacioncuerpo;


--
-- TOC entry 935 (class 1259 OID 89047)
-- Dependencies: 7474 11
-- Name: unificacioncarpeta; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE unificacioncarpeta (
    idunificacioncarpeta integer NOT NULL,
    carpetaquequeda integer NOT NULL,
    carpetaunificada integer NOT NULL,
    usuario character varying(10) NOT NULL,
    fecha timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.unificacioncarpeta OWNER TO postgres;

--
-- TOC entry 936 (class 1259 OID 89051)
-- Dependencies: 935 11
-- Name: unificacioncarpeta_idunificacioncarpeta_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE unificacioncarpeta_idunificacioncarpeta_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.unificacioncarpeta_idunificacioncarpeta_seq OWNER TO postgres;

--
-- TOC entry 10823 (class 0 OID 0)
-- Dependencies: 936
-- Name: unificacioncarpeta_idunificacioncarpeta_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE unificacioncarpeta_idunificacioncarpeta_seq OWNED BY unificacioncarpeta.idunificacioncarpeta;


--
-- TOC entry 937 (class 1259 OID 89053)
-- Dependencies: 11
-- Name: unificacionpersona; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE unificacionpersona (
    idunificacionpersona integer NOT NULL,
    personaquequeda integer NOT NULL,
    personaunificada integer NOT NULL,
    fecha timestamp without time zone NOT NULL,
    usuario character varying(10) NOT NULL
);


ALTER TABLE public.unificacionpersona OWNER TO postgres;

--
-- TOC entry 10824 (class 0 OID 0)
-- Dependencies: 937
-- Name: COLUMN unificacionpersona.idunificacionpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN unificacionpersona.idunificacionpersona IS 'id de la unificacion';


--
-- TOC entry 10825 (class 0 OID 0)
-- Dependencies: 937
-- Name: COLUMN unificacionpersona.personaquequeda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN unificacionpersona.personaquequeda IS 'Persona que persiste en la base de datos';


--
-- TOC entry 10826 (class 0 OID 0)
-- Dependencies: 937
-- Name: COLUMN unificacionpersona.personaunificada; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN unificacionpersona.personaunificada IS 'Persona que se elimina de la base de datos';


--
-- TOC entry 10827 (class 0 OID 0)
-- Dependencies: 937
-- Name: COLUMN unificacionpersona.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN unificacionpersona.usuario IS 'usuario que realiza la unificacion';


--
-- TOC entry 938 (class 1259 OID 89056)
-- Dependencies: 937 11
-- Name: unificacionpersona_idunificacionpersona_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE unificacionpersona_idunificacionpersona_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.unificacionpersona_idunificacionpersona_seq OWNER TO postgres;

--
-- TOC entry 10828 (class 0 OID 0)
-- Dependencies: 938
-- Name: unificacionpersona_idunificacionpersona_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE unificacionpersona_idunificacionpersona_seq OWNED BY unificacionpersona.idunificacionpersona;


--
-- TOC entry 939 (class 1259 OID 89058)
-- Dependencies: 11
-- Name: usuario_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    login character varying(10) NOT NULL,
    password character varying(100) NOT NULL,
    primernombre character varying(20) NOT NULL,
    segundonombre character varying(20) NOT NULL,
    primerapellido character varying(20) NOT NULL,
    segundoapellido character varying(20) NOT NULL,
    idperfil integer NOT NULL,
    idcargo integer NOT NULL,
    rol character varying(20) NOT NULL,
    usuario character varying(10),
    idprocedenciausuario bigint,
    cedula character varying(50),
    codigo character varying(50),
    idmunicipiolabor integer,
    correo character varying(100),
    fechaultimoingreso timestamp without time zone,
    fechaultimocambioclave timestamp without time zone,
    cambiaclave boolean
);


ALTER TABLE public.usuario_audit OWNER TO postgres;

--
-- TOC entry 10829 (class 0 OID 0)
-- Dependencies: 939
-- Name: TABLE usuario_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE usuario_audit IS 'Usuario del Sistema de informacion Justicia y Paz';


--
-- TOC entry 10830 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10831 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.fechaactualizacion IS 'Fecha de actualizacion del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10832 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.login; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.login IS 'Identificador del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10833 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.password; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.password IS 'Contrasena del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10834 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.primernombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.primernombre IS 'Primer nombre del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10835 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.segundonombre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.segundonombre IS 'Segundo nombre del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10836 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.primerapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.primerapellido IS 'Primer apellido del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10837 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.segundoapellido; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.segundoapellido IS 'Segundo apellido del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10838 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.idperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.idperfil IS 'Identificador unico del perfil del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10839 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.idcargo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.idcargo IS 'Identificador unico del cargo del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10840 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.rol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.rol IS 'Rol del usuario del Sistema de Informacion Justicia y Paz, que puede ser inactivo o sijyp';


--
-- TOC entry 10841 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.usuario IS 'creador del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10842 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.idprocedenciausuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.idprocedenciausuario IS 'Identificador unico de la procedencia del usuario creador de usuario';


--
-- TOC entry 10843 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.cedula; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.cedula IS 'Numero de cedula del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10844 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.codigo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.codigo IS 'Codigo del usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 10845 (class 0 OID 0)
-- Dependencies: 939
-- Name: COLUMN usuario_audit.idmunicipiolabor; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario_audit.idmunicipiolabor IS 'Identificador unico del municipio donde labora el usuario del Sistema de Informacion de Justicia y Paz';


--
-- TOC entry 940 (class 1259 OID 89061)
-- Dependencies: 7477 11
-- Name: version; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE version (
    idversion integer NOT NULL,
    fechaversion date NOT NULL,
    etapaproceso bigint NOT NULL,
    idsalaversion bigint NOT NULL,
    idmunicipio bigint,
    lugar character varying(100),
    usuario character varying(10) NOT NULL,
    esmultiple boolean DEFAULT false NOT NULL
);


ALTER TABLE public.version OWNER TO postgres;

--
-- TOC entry 10846 (class 0 OID 0)
-- Dependencies: 940
-- Name: TABLE version; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE version IS 'Version del proceso de Justicia y Paz';


--
-- TOC entry 10847 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.idversion IS 'Identificador unico de una version de Justicia y Paz.';


--
-- TOC entry 10848 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.fechaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.fechaversion IS 'Fecha en la que se realiza la version libre de justicia y paz.';


--
-- TOC entry 10849 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.etapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.etapaproceso IS 'Etapa del proceso en la que se realiza la version de justicia y paz.';


--
-- TOC entry 10850 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.idsalaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.idsalaversion IS 'Sala de version donde se realizo la version.
Si es 0 la sala es movil.';


--
-- TOC entry 10851 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.idmunicipio IS 'Municipio donde se realiza la versiona cuando la sala es movil.';


--
-- TOC entry 10852 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.lugar; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.lugar IS 'Lugar donde se realiza la version cuando la sala es movil.';


--
-- TOC entry 10853 (class 0 OID 0)
-- Dependencies: 940
-- Name: COLUMN version.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version.usuario IS 'Usuario que realiza la actualizacion.';


--
-- TOC entry 941 (class 1259 OID 89065)
-- Dependencies: 11
-- Name: version_audit; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE version_audit (
    accion character varying(1),
    fechaactualizacion timestamp without time zone,
    idversion bigint,
    fechaversion date,
    etapaproceso bigint,
    idsalaversion bigint,
    idmunicipio bigint,
    lugar character varying(100),
    usuario character varying(10),
    esmultiple boolean
);


ALTER TABLE public.version_audit OWNER TO postgres;

--
-- TOC entry 10854 (class 0 OID 0)
-- Dependencies: 941
-- Name: TABLE version_audit; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE version_audit IS 'Version del proceso de Justicia y Paz';


--
-- TOC entry 10855 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.accion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.accion IS 'ACCIONES CONTROLADAS:
Insertar - I
Borrar - D
Actualizar - X y U
Como Estaba - X
Como Quedo - U
Bajo descripcion PostgreSQL';


--
-- TOC entry 10856 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.fechaactualizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.fechaactualizacion IS 'Fecha de actualizacion de la version';


--
-- TOC entry 10857 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.idversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.idversion IS 'Identificador unico de una version de Justicia y Paz';


--
-- TOC entry 10858 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.fechaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.fechaversion IS 'Fecha en la que se realiza la version libre de justicia y paz';


--
-- TOC entry 10859 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.etapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.etapaproceso IS 'Etapa del proceso en la que se realiza la version de justicia y paz';


--
-- TOC entry 10860 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.idsalaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.idsalaversion IS 'Sala de version donde se realizo la version.
Si es 0 la sala es movil';


--
-- TOC entry 10861 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.idmunicipio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.idmunicipio IS 'Municipio donde se realiza la versiona cuando la sala es movil';


--
-- TOC entry 10862 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.lugar; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.lugar IS 'Lugar donde se realiza la version cuando la sala es movi';


--
-- TOC entry 10863 (class 0 OID 0)
-- Dependencies: 941
-- Name: COLUMN version_audit.usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN version_audit.usuario IS 'Usuario que realiza la actualizacion';


--
-- TOC entry 942 (class 1259 OID 89068)
-- Dependencies: 940 11
-- Name: version_idversion_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE version_idversion_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.version_idversion_seq OWNER TO postgres;

--
-- TOC entry 10864 (class 0 OID 0)
-- Dependencies: 942
-- Name: version_idversion_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE version_idversion_seq OWNED BY version.idversion;


--
-- TOC entry 943 (class 1259 OID 89070)
-- Dependencies: 11
-- Name: victima_idvictima_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE victima_idvictima_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 4294967295
    CACHE 1;


ALTER TABLE public.victima_idvictima_seq OWNER TO postgres;

--
-- TOC entry 321 (class 1259 OID 85062)
-- Dependencies: 11
-- Name: vs_database_diagrams; Type: TABLE; Schema: public; Owner: sijyp; Tablespace: 
--

CREATE TABLE vs_database_diagrams (
    name character varying(80),
    diadata text,
    comment character varying(1022),
    preview text,
    lockinfo character varying(80),
    locktime timestamp with time zone,
    version character varying(80)
);


ALTER TABLE public.vs_database_diagrams OWNER TO sijyp;

--
-- TOC entry 7245 (class 2604 OID 89072)
-- Dependencies: 337 335
-- Name: idacta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion ALTER COLUMN idacta SET DEFAULT nextval('acta_asignacion_idacta_seq'::regclass);


--
-- TOC entry 7247 (class 2604 OID 89073)
-- Dependencies: 342 340
-- Name: idactividadfuenteinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actividadfuenteinformacion ALTER COLUMN idactividadfuenteinformacion SET DEFAULT nextval('actividadfuenteinformacion_idactividadfuenteinformacion_seq'::regclass);


--
-- TOC entry 7248 (class 2604 OID 89074)
-- Dependencies: 345 343
-- Name: idhistoricoprocesaldecision; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actuacionhistoricoprocesal ALTER COLUMN idhistoricoprocesaldecision SET DEFAULT nextval('actuacionhistoricoprocesal_idhistoricoprocesaldecision_seq'::regclass);


--
-- TOC entry 7249 (class 2604 OID 89075)
-- Dependencies: 348 346
-- Name: idalbumfotografico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico ALTER COLUMN idalbumfotografico SET DEFAULT nextval('albumfotografico_idalbumfotografico_seq'::regclass);


--
-- TOC entry 7250 (class 2604 OID 89076)
-- Dependencies: 352 349
-- Name: idalbumfotograficodownload; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotograficodownload ALTER COLUMN idalbumfotograficodownload SET DEFAULT nextval('albumfotograficodownload_idalbumfotograficodownload_seq'::regclass);


--
-- TOC entry 7251 (class 2604 OID 89077)
-- Dependencies: 351 350
-- Name: idalbumfotograficodownload; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotograficodownload_audit ALTER COLUMN idalbumfotograficodownload SET DEFAULT nextval('albumfotograficodownload_audit_idalbumfotograficodownload_seq'::regclass);


--
-- TOC entry 7253 (class 2604 OID 89078)
-- Dependencies: 360 357
-- Name: idasignaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado ALTER COLUMN idasignaciongrupoarmado SET DEFAULT nextval('asignaciongrupoarmado_idasignaciongrupoarmado_seq'::regclass);


--
-- TOC entry 7255 (class 2604 OID 89079)
-- Dependencies: 359 358
-- Name: idasignaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado_audit ALTER COLUMN idasignaciongrupoarmado SET DEFAULT nextval('asignaciongrupoarmado_audit_idasignaciongrupoarmado_seq'::regclass);


--
-- TOC entry 7256 (class 2604 OID 89080)
-- Dependencies: 362 361
-- Name: idasignaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmadohistorico ALTER COLUMN idasignaciongrupoarmado SET DEFAULT nextval('asignaciongrupoarmadohistorico_idasignaciongrupoarmado_seq'::regclass);


--
-- TOC entry 7262 (class 2604 OID 89081)
-- Dependencies: 366 364
-- Name: idaudiencia; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY audiencia ALTER COLUMN idaudiencia SET DEFAULT nextval('audiencia_idaudiencia_seq'::regclass);


--
-- TOC entry 7269 (class 2604 OID 89082)
-- Dependencies: 384 382
-- Name: idcarpetahecho; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho ALTER COLUMN idcarpetahecho SET DEFAULT nextval('carpetahecho_idcarpetahecho_seq'::regclass);


--
-- TOC entry 7272 (class 2604 OID 89083)
-- Dependencies: 387 385
-- Name: idcausaterminacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY causaterminacionprocesopostulado ALTER COLUMN idcausaterminacion SET DEFAULT nextval('causaterminacionprocesopostulado_idcausaterminacion_seq'::regclass);


--
-- TOC entry 7274 (class 2604 OID 89084)
-- Dependencies: 393 391
-- Name: idcompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY compulsacion ALTER COLUMN idcompulsacion SET DEFAULT nextval('compulsacion_idcompulsacion_seq'::regclass);


--
-- TOC entry 7275 (class 2604 OID 89085)
-- Dependencies: 396 394
-- Name: idconnotacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY connotacion ALTER COLUMN idconnotacion SET DEFAULT nextval('connotacion_idconnotacion_seq'::regclass);


--
-- TOC entry 7276 (class 2604 OID 89086)
-- Dependencies: 399 397
-- Name: conteo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY controlregistrohechos ALTER COLUMN conteo SET DEFAULT nextval('controlregistrohechos_conteo_seq'::regclass);


--
-- TOC entry 7277 (class 2604 OID 89087)
-- Dependencies: 403 402
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY datosconsultaporusuario ALTER COLUMN id SET DEFAULT nextval('datosconsultaporusuario_id_seq'::regclass);


--
-- TOC entry 7278 (class 2604 OID 89088)
-- Dependencies: 406 404
-- Name: iddecisionterminacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado ALTER COLUMN iddecisionterminacion SET DEFAULT nextval('decisionterminacionprocesopostulado_iddecisionterminacion_seq'::regclass);


--
-- TOC entry 7283 (class 2604 OID 89089)
-- Dependencies: 416 414
-- Name: iddesmovilizacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion ALTER COLUMN iddesmovilizacion SET DEFAULT nextval('desmovilizacion_iddesmovilizacion_seq'::regclass);


--
-- TOC entry 7284 (class 2604 OID 89090)
-- Dependencies: 421 419
-- Name: iddespacho; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY despacho ALTER COLUMN iddespacho SET DEFAULT nextval('despacho_iddespacho_seq'::regclass);


--
-- TOC entry 7286 (class 2604 OID 89091)
-- Dependencies: 424 422
-- Name: iddocumento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento ALTER COLUMN iddocumento SET DEFAULT nextval('documento_iddocumento_seq'::regclass);


--
-- TOC entry 7287 (class 2604 OID 89092)
-- Dependencies: 427 425
-- Name: iddocumentocarpeta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocarpeta ALTER COLUMN iddocumentocarpeta SET DEFAULT nextval('documentocarpeta_iddocumentocarpeta_seq'::regclass);


--
-- TOC entry 7288 (class 2604 OID 89093)
-- Dependencies: 431 428
-- Name: iddocumentocompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocompulsacion ALTER COLUMN iddocumentocompulsacion SET DEFAULT nextval('documentocompulsacion_iddocumentocompulsacion_seq'::regclass);


--
-- TOC entry 7289 (class 2604 OID 89094)
-- Dependencies: 430 429
-- Name: iddocumentocompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocompulsacion_audit ALTER COLUMN iddocumentocompulsacion SET DEFAULT nextval('documentocompulsacion_audit_iddocumentocompulsacion_seq'::regclass);


--
-- TOC entry 7290 (class 2604 OID 89095)
-- Dependencies: 433 432
-- Name: iddocumentocuerpotipoacta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocuerpotipoacta ALTER COLUMN iddocumentocuerpotipoacta SET DEFAULT nextval('documentocuerpotipoacta_iddocumentocuerpotipoacta_seq'::regclass);


--
-- TOC entry 7292 (class 2604 OID 89096)
-- Dependencies: 436 434
-- Name: iddocumentoedictoemplazatorio; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentoedictoemplazatorio ALTER COLUMN iddocumentoedictoemplazatorio SET DEFAULT nextval('documentoedictoemplazatorio_iddocumentoedictoemplazatorio_seq'::regclass);


--
-- TOC entry 7293 (class 2604 OID 89097)
-- Dependencies: 439 437
-- Name: iddocumentopersona; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona ALTER COLUMN iddocumentopersona SET DEFAULT nextval('documentopersona_iddocumentopersona_seq'::regclass);


--
-- TOC entry 7295 (class 2604 OID 89098)
-- Dependencies: 442 440
-- Name: iddocumentopostulacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopostulacion ALTER COLUMN iddocumentopostulacion SET DEFAULT nextval('documentopostulacion_iddocumentopostulacion_seq'::regclass);


--
-- TOC entry 7296 (class 2604 OID 89099)
-- Dependencies: 445 443
-- Name: iddocumentospostulacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentospostulacion ALTER COLUMN iddocumentospostulacion SET DEFAULT nextval('documentospostulacion_iddocumentospostulacion_seq'::regclass);


--
-- TOC entry 7297 (class 2604 OID 89100)
-- Dependencies: 447 446
-- Name: iddocumentoacta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentotipoacta ALTER COLUMN iddocumentoacta SET DEFAULT nextval('documentotipoacta_iddocumentoacta_seq'::regclass);


--
-- TOC entry 7298 (class 2604 OID 89101)
-- Dependencies: 449 448
-- Name: idelemento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY elemento ALTER COLUMN idelemento SET DEFAULT nextval('elemento_idelemento_seq'::regclass);


--
-- TOC entry 7300 (class 2604 OID 89102)
-- Dependencies: 454 452
-- Name: idestadoetapaproceso; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadoetapaproceso ALTER COLUMN idestadoetapaproceso SET DEFAULT nextval('estadoetapaproceso_idestadoetapaproceso_seq'::regclass);


--
-- TOC entry 7301 (class 2604 OID 89103)
-- Dependencies: 457 455
-- Name: idestadohistoricoprocesal; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadohistoricoprocesal ALTER COLUMN idestadohistoricoprocesal SET DEFAULT nextval('estadohistoricoprocesal_idestadohistoricoprocesal_seq'::regclass);


--
-- TOC entry 7302 (class 2604 OID 89104)
-- Dependencies: 460 458
-- Name: idestadopostulado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadopostulado ALTER COLUMN idestadopostulado SET DEFAULT nextval('estadopostulado_idestadopostulado_seq'::regclass);


--
-- TOC entry 7303 (class 2604 OID 89105)
-- Dependencies: 463 461
-- Name: idestadoprogramacionreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadoprogramacionreporte ALTER COLUMN idestadoprogramacionreporte SET DEFAULT nextval('estadoprogramacionreporte_idestadoprogramacionreporte_seq'::regclass);


--
-- TOC entry 7305 (class 2604 OID 89106)
-- Dependencies: 468 466
-- Name: idetapaflujoinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapaflujoinformacion ALTER COLUMN idetapaflujoinformacion SET DEFAULT nextval('etapaflujoinformacion_idetapaflujoinformacion_seq'::regclass);


--
-- TOC entry 7306 (class 2604 OID 89107)
-- Dependencies: 471 469
-- Name: idetapahistoricoprocesal; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapahistoricoprocesal ALTER COLUMN idetapahistoricoprocesal SET DEFAULT nextval('etapahistoricoprocesal_idetapahistoricoprocesal_seq'::regclass);


--
-- TOC entry 7308 (class 2604 OID 89108)
-- Dependencies: 474 472
-- Name: idetapaproceso; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapaproceso ALTER COLUMN idetapaproceso SET DEFAULT nextval('etapaproceso_idetapaproceso_seq'::regclass);


--
-- TOC entry 7316 (class 2604 OID 89109)
-- Dependencies: 477 475
-- Name: idevento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento ALTER COLUMN idevento SET DEFAULT nextval('evento_idevento_seq1'::regclass);


--
-- TOC entry 7317 (class 2604 OID 89110)
-- Dependencies: 481 478
-- Name: idfactoringresoga; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY factoringresoga ALTER COLUMN idfactoringresoga SET DEFAULT nextval('factoringresoga_idfactoringresoga_seq'::regclass);


--
-- TOC entry 7318 (class 2604 OID 89111)
-- Dependencies: 480 479
-- Name: idfactoringresoga; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY factoringresoga_audit ALTER COLUMN idfactoringresoga SET DEFAULT nextval('factoringresoga_audit_idfactoringresoga_seq'::regclass);


--
-- TOC entry 7319 (class 2604 OID 89112)
-- Dependencies: 483 482
-- Name: idformatoreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY formatoreporte ALTER COLUMN idformatoreporte SET DEFAULT nextval('formatoreporte_idformatoreporte_seq'::regclass);


--
-- TOC entry 7323 (class 2604 OID 89113)
-- Dependencies: 495 492
-- Name: idfuenteinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos ALTER COLUMN idfuenteinformacion SET DEFAULT nextval('fuenteinformaciondatos_idfuenteinformacion_seq'::regclass);


--
-- TOC entry 7324 (class 2604 OID 89114)
-- Dependencies: 494 493
-- Name: idfuenteinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos_audit ALTER COLUMN idfuenteinformacion SET DEFAULT nextval('fuenteinformaciondatos_audit_idfuenteinformacion_seq'::regclass);


--
-- TOC entry 7326 (class 2604 OID 89115)
-- Dependencies: 503 500
-- Name: idgenesisgrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado ALTER COLUMN idgenesisgrupoarmado SET DEFAULT nextval('genesisgrupoarmado_idgenesisgrupoarmado_seq'::regclass);


--
-- TOC entry 7327 (class 2604 OID 89116)
-- Dependencies: 502 501
-- Name: idgenesisgrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado_audit ALTER COLUMN idgenesisgrupoarmado SET DEFAULT nextval('genesisgrupoarmado_audit_idgenesisgrupoarmado_seq'::regclass);


--
-- TOC entry 7329 (class 2604 OID 89117)
-- Dependencies: 508 506
-- Name: idgeoreferenciaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado ALTER COLUMN idgeoreferenciaciongrupoarmado SET DEFAULT nextval('georeferenciaciongrupoarmado_idgeoreferenciaciongrupoarmado_seq'::regclass);


--
-- TOC entry 7331 (class 2604 OID 89118)
-- Dependencies: 513 511
-- Name: idgrupos_etnicos; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY grupos_etnicos ALTER COLUMN idgrupos_etnicos SET DEFAULT nextval('grupos_etnicos_idgrupos_etnicos_seq'::regclass);


--
-- TOC entry 7333 (class 2604 OID 89119)
-- Dependencies: 518 516
-- Name: idhecho; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho ALTER COLUMN idhecho SET DEFAULT nextval('hecho_idhecho_seq1'::regclass);


--
-- TOC entry 7336 (class 2604 OID 89120)
-- Dependencies: 524 522
-- Name: idhistorialreclusion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion ALTER COLUMN idhistorialreclusion SET DEFAULT nextval('historialreclusion_idhistorialreclusion_seq'::regclass);


--
-- TOC entry 7338 (class 2604 OID 89121)
-- Dependencies: 532 530
-- Name: idhistoricoprocesal; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal ALTER COLUMN idhistoricoprocesal SET DEFAULT nextval('historicoprocesal_idhistoricoprocesal_seq'::regclass);


--
-- TOC entry 7339 (class 2604 OID 89122)
-- Dependencies: 536 534
-- Name: ididentificacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificacion ALTER COLUMN ididentificacion SET DEFAULT nextval('identificacion_ididentificacion_seq'::regclass);


--
-- TOC entry 7340 (class 2604 OID 89123)
-- Dependencies: 539 537
-- Name: ididentificaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado ALTER COLUMN ididentificaciongrupoarmado SET DEFAULT nextval('identificaciongrupoarmado_ididentificaciongrupoarmado_seq'::regclass);


--
-- TOC entry 7341 (class 2604 OID 89124)
-- Dependencies: 542 540
-- Name: idjornadaaudiencia; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY jornadaaudiencia ALTER COLUMN idjornadaaudiencia SET DEFAULT nextval('jornadaaudiencia_idjornadaaudiencia_seq'::regclass);


--
-- TOC entry 7342 (class 2604 OID 89125)
-- Dependencies: 544 543
-- Name: idcaracteristica; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY listacaracteristica ALTER COLUMN idcaracteristica SET DEFAULT nextval('listacaracteristica_idcaracteristica_seq'::regclass);


--
-- TOC entry 7229 (class 2604 OID 89126)
-- Dependencies: 547 326
-- Name: idmagistrado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY magistrado ALTER COLUMN idmagistrado SET DEFAULT nextval('magistrado_idmagistrado_seq'::regclass);


--
-- TOC entry 7343 (class 2604 OID 89127)
-- Dependencies: 550 548
-- Name: idmediopublicacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY mediopublicacion ALTER COLUMN idmediopublicacion SET DEFAULT nextval('mediopublicacion_idmediopublicacion_seq'::regclass);


--
-- TOC entry 7345 (class 2604 OID 89128)
-- Dependencies: 556 554
-- Name: idmodusoperandi; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY modusoperandi ALTER COLUMN idmodusoperandi SET DEFAULT nextval('modusoperandi_idmodusoperandi_seq'::regclass);


--
-- TOC entry 7346 (class 2604 OID 89129)
-- Dependencies: 558 557
-- Name: idmotivoterminacionetapapostulado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY motivoterminacionetapapostulado ALTER COLUMN idmotivoterminacionetapapostulado SET DEFAULT nextval('motivoterminacionetapapostula_idmotivoterminacionetapapostu_seq'::regclass);


--
-- TOC entry 7347 (class 2604 OID 89130)
-- Dependencies: 562 560
-- Name: idmovil; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY movil ALTER COLUMN idmovil SET DEFAULT nextval('movil_idmovil_seq'::regclass);


--
-- TOC entry 7349 (class 2604 OID 89131)
-- Dependencies: 567 565
-- Name: idnivel; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY nivel ALTER COLUMN idnivel SET DEFAULT nextval('nivel_idnivel_seq'::regclass);


--
-- TOC entry 7351 (class 2604 OID 89132)
-- Dependencies: 572 570
-- Name: idnotificacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion ALTER COLUMN idnotificacion SET DEFAULT nextval('notificacion_idnotificacion_seq'::regclass);


--
-- TOC entry 7354 (class 2604 OID 89133)
-- Dependencies: 575 573
-- Name: idnotificacioncorreo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacioncorreo ALTER COLUMN idnotificacioncorreo SET DEFAULT nextval('notificacioncorreo_idnotificacioncorreo_seq'::regclass);


--
-- TOC entry 7355 (class 2604 OID 89134)
-- Dependencies: 577 576
-- Name: idorigen; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origen ALTER COLUMN idorigen SET DEFAULT nextval('origen_idorigen_seq'::regclass);


--
-- TOC entry 7356 (class 2604 OID 89135)
-- Dependencies: 580 578
-- Name: idorigenevento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenevento ALTER COLUMN idorigenevento SET DEFAULT nextval('origenevento_idorigenevento_seq'::regclass);


--
-- TOC entry 7357 (class 2604 OID 89136)
-- Dependencies: 583 581
-- Name: idorigenfuenteinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenfuenteinformacion ALTER COLUMN idorigenfuenteinformacion SET DEFAULT nextval('origenfuenteinformacion_idorigenfuenteinformacion_seq'::regclass);


--
-- TOC entry 7358 (class 2604 OID 89137)
-- Dependencies: 586 584
-- Name: idorigenhechoversion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenhechoversion ALTER COLUMN idorigenhechoversion SET DEFAULT nextval('origenhechoversion_idorigenhechoversion_seq'::regclass);


--
-- TOC entry 7360 (class 2604 OID 89138)
-- Dependencies: 591 589
-- Name: idpartidos_politicos; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY partidos_politicos ALTER COLUMN idpartidos_politicos SET DEFAULT nextval('partidos_politicos_idpartidos_politicos_seq'::regclass);


--
-- TOC entry 7362 (class 2604 OID 89139)
-- Dependencies: 597 595
-- Name: idpersonacambioidentidad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad ALTER COLUMN idpersonacambioidentidad SET DEFAULT nextval('personacambiodeidentidad_idpersonacambioidentidad_seq'::regclass);


--
-- TOC entry 7363 (class 2604 OID 89140)
-- Dependencies: 600 598
-- Name: idpersonaestadohistorico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadohistorico ALTER COLUMN idpersonaestadohistorico SET DEFAULT nextval('personaestadohistorico_idpersonaestadohistorico_seq'::regclass);


--
-- TOC entry 7365 (class 2604 OID 89141)
-- Dependencies: 603 601
-- Name: idpersonaestadosocioeconomico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico ALTER COLUMN idpersonaestadosocioeconomico SET DEFAULT nextval('personaestadosocioeconomico_idpersonaestadosocioeconomico_seq'::regclass);


--
-- TOC entry 7235 (class 2604 OID 89142)
-- Dependencies: 605 330
-- Name: idpersonajuridicacolectividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad ALTER COLUMN idpersonajuridicacolectividad SET DEFAULT nextval('personajuridicacolectividad_idpersonajuridicacolectividad_seq'::regclass);


--
-- TOC entry 7367 (class 2604 OID 89143)
-- Dependencies: 607 606
-- Name: idpersonajuridicacolectividadcorreo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividadcorreo ALTER COLUMN idpersonajuridicacolectividadcorreo SET DEFAULT nextval('personajuridicacolectividadco_idpersonajuridicacolectividad_seq'::regclass);


--
-- TOC entry 7374 (class 2604 OID 89144)
-- Dependencies: 613 611
-- Name: idpostuladoasignacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion ALTER COLUMN idpostuladoasignacion SET DEFAULT nextval('postuladoasignacion_idpostuladoasignacion_seq'::regclass);


--
-- TOC entry 7380 (class 2604 OID 89145)
-- Dependencies: 617 616
-- Name: idprocedenciausuario; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY procedenciausuario ALTER COLUMN idprocedenciausuario SET DEFAULT nextval('procedenciausuario_idprocedenciausuario_seq'::regclass);


--
-- TOC entry 7382 (class 2604 OID 89146)
-- Dependencies: 622 620
-- Name: idprogramacionreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY programacionreporte ALTER COLUMN idprogramacionreporte SET DEFAULT nextval('programacionreporte_idprogramacionreporte_seq'::regclass);


--
-- TOC entry 7383 (class 2604 OID 89147)
-- Dependencies: 625 623
-- Name: idpublicacionexterna; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacionexterna ALTER COLUMN idpublicacionexterna SET DEFAULT nextval('publicacionexterna_idpublicacionexterna_seq'::regclass);


--
-- TOC entry 7384 (class 2604 OID 89148)
-- Dependencies: 628 626
-- Name: idpublicacioninterna; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacioninterna ALTER COLUMN idpublicacioninterna SET DEFAULT nextval('publicacioninterna_idpublicacioninterna_seq'::regclass);


--
-- TOC entry 7386 (class 2604 OID 89149)
-- Dependencies: 633 631
-- Name: idraza; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY raza ALTER COLUMN idraza SET DEFAULT nextval('raza_idraza_seq'::regclass);


--
-- TOC entry 7387 (class 2604 OID 89150)
-- Dependencies: 637 635
-- Name: idregistrohecho; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho ALTER COLUMN idregistrohecho SET DEFAULT nextval('registrohecho_idregistrohecho_seq'::regclass);


--
-- TOC entry 7389 (class 2604 OID 89151)
-- Dependencies: 644 642
-- Name: idrelacionaudienciacarpeta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta ALTER COLUMN idrelacionaudienciacarpeta SET DEFAULT nextval('relacionaudienciacarpeta_idrelacionaudienciacarpeta_seq'::regclass);


--
-- TOC entry 7244 (class 2604 OID 89152)
-- Dependencies: 705 332
-- Name: idrelacionpersonajuridicacolectividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad ALTER COLUMN idrelacionpersonajuridicacolectividad SET DEFAULT nextval('relacionpersonajuridicacolect_idrelacionpersonajuridicacole_seq'::regclass);


--
-- TOC entry 7397 (class 2604 OID 89153)
-- Dependencies: 733 731
-- Name: idreligion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY religion ALTER COLUMN idreligion SET DEFAULT nextval('religion_idreligion_seq'::regclass);


--
-- TOC entry 7398 (class 2604 OID 89154)
-- Dependencies: 736 735
-- Name: idreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporte_audit ALTER COLUMN idreporte SET DEFAULT nextval('reporte_audit_idreporte_seq'::regclass);


--
-- TOC entry 7399 (class 2604 OID 89155)
-- Dependencies: 741 739
-- Name: idresolucionasignacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY resolucionasignacion ALTER COLUMN idresolucionasignacion SET DEFAULT nextval('resolucionasignacion_idresolucionasignacion_seq'::regclass);


--
-- TOC entry 7401 (class 2604 OID 89156)
-- Dependencies: 746 744
-- Name: idsalaconocimiento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY salaconocimiento ALTER COLUMN idsalaconocimiento SET DEFAULT nextval('salaconocimiento_idsalaconocimiento_seq'::regclass);


--
-- TOC entry 7402 (class 2604 OID 89157)
-- Dependencies: 749 747
-- Name: idsalaversion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY salaversion ALTER COLUMN idsalaversion SET DEFAULT nextval('salaversion_idsalaversion_seq'::regclass);


--
-- TOC entry 7403 (class 2604 OID 89158)
-- Dependencies: 751 750
-- Name: idsede; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sede ALTER COLUMN idsede SET DEFAULT nextval('sede_idsede_seq'::regclass);


--
-- TOC entry 7404 (class 2604 OID 89159)
-- Dependencies: 758 756
-- Name: idsolicitudterminacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado ALTER COLUMN idsolicitudterminacion SET DEFAULT nextval('solicitudterminacionprocesopostulado_idsolicitudterminacion_seq'::regclass);


--
-- TOC entry 7405 (class 2604 OID 89160)
-- Dependencies: 762 760
-- Name: idtendenciasexual; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tendenciasexual ALTER COLUMN idtendenciasexual SET DEFAULT nextval('tendenciasexual_idtendenciasexual_seq'::regclass);


--
-- TOC entry 7406 (class 2604 OID 89161)
-- Dependencies: 765 763
-- Name: idterminacionetapaprocesal; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY terminacionetapaprocesal ALTER COLUMN idterminacionetapaprocesal SET DEFAULT nextval('terminacionetapaprocesal_idterminacionetapaprocesal_seq'::regclass);


--
-- TOC entry 7408 (class 2604 OID 89162)
-- Dependencies: 768 766
-- Name: idtipoaccesosalud; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaccesosalud ALTER COLUMN idtipoaccesosalud SET DEFAULT nextval('tipoaccesosalud_idtipoaccesosalud_seq'::regclass);


--
-- TOC entry 7409 (class 2604 OID 89163)
-- Dependencies: 771 769
-- Name: idtipoactaasignacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactaasignacion ALTER COLUMN idtipoactaasignacion SET DEFAULT nextval('tipoactaasignacion_idtipoactaasignacion_seq'::regclass);


--
-- TOC entry 7410 (class 2604 OID 89164)
-- Dependencies: 773 772
-- Name: idtipoactuacionhistoricoprocesal; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactuacionhistoricoprocesal ALTER COLUMN idtipoactuacionhistoricoprocesal SET DEFAULT nextval('tipoactuacionhistoricoprocesa_idtipoactuacionhistoricoproce_seq'::regclass);


--
-- TOC entry 7412 (class 2604 OID 89165)
-- Dependencies: 776 775
-- Name: idtipoadquisicion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoadquisicion ALTER COLUMN idtipoadquisicion SET DEFAULT nextval('tipoadquisicion_idtipoadquisicion_seq'::regclass);


--
-- TOC entry 7413 (class 2604 OID 89166)
-- Dependencies: 779 777
-- Name: idtipoalbumfotografico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoalbumfotografico ALTER COLUMN idtipoalbumfotografico SET DEFAULT nextval('tipoalbumfotografico_idtipoalbumfotografico_seq'::regclass);


--
-- TOC entry 7414 (class 2604 OID 89167)
-- Dependencies: 782 780
-- Name: idtipoaplicaley; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaplicaley ALTER COLUMN idtipoaplicaley SET DEFAULT nextval('tipoaplicaley_idtipoaplicaley_seq'::regclass);


--
-- TOC entry 7415 (class 2604 OID 89168)
-- Dependencies: 785 783
-- Name: idtipoapoderado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoapoderado ALTER COLUMN idtipoapoderado SET DEFAULT nextval('tipoapoderado_idtipoapoderado_seq'::regclass);


--
-- TOC entry 7416 (class 2604 OID 89169)
-- Dependencies: 789 786
-- Name: idtipoaudiencia; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaudiencia ALTER COLUMN idtipoaudiencia SET DEFAULT nextval('tipoaudiencia_idtipoaudiencia_seq'::regclass);


--
-- TOC entry 7417 (class 2604 OID 89170)
-- Dependencies: 788 787
-- Name: idtipoaudiencia; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaudiencia_audit ALTER COLUMN idtipoaudiencia SET DEFAULT nextval('tipoaudiencia_audit_idtipoaudiencia_seq'::regclass);


--
-- TOC entry 7418 (class 2604 OID 89171)
-- Dependencies: 791 790
-- Name: idtipobien; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipobien ALTER COLUMN idtipobien SET DEFAULT nextval('tipobien_idtipobien_seq'::regclass);


--
-- TOC entry 7419 (class 2604 OID 89172)
-- Dependencies: 794 792
-- Name: idtipocaratula; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocaratula ALTER COLUMN idtipocaratula SET DEFAULT nextval('tipocaratula_idtipocaratula_seq'::regclass);


--
-- TOC entry 7420 (class 2604 OID 89173)
-- Dependencies: 796 795
-- Name: idtipoclasificacionpersonajuridica; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoclasificacionpersonajuridica ALTER COLUMN idtipoclasificacionpersonajuridica SET DEFAULT nextval('tipoclasificacionpersonajurid_idtipoclasificacionpersonajur_seq'::regclass);


--
-- TOC entry 7421 (class 2604 OID 89174)
-- Dependencies: 800 798
-- Name: idtipocompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocompulsacion ALTER COLUMN idtipocompulsacion SET DEFAULT nextval('tipocompulsacion_idtipocompulsacion_seq'::regclass);


--
-- TOC entry 7423 (class 2604 OID 89175)
-- Dependencies: 805 803
-- Name: idtipodiscapacidad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodiscapacidad ALTER COLUMN idtipodiscapacidad SET DEFAULT nextval('tipodiscapacidad_idtipodiscapacidad_seq'::regclass);


--
-- TOC entry 7424 (class 2604 OID 89176)
-- Dependencies: 808 806
-- Name: idtipodocumento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumento ALTER COLUMN idtipodocumento SET DEFAULT nextval('tipodocumento_idtipodocumento_seq'::regclass);


--
-- TOC entry 7425 (class 2604 OID 89177)
-- Dependencies: 811 809
-- Name: idtipodocumentocarpeta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentocarpeta ALTER COLUMN idtipodocumentocarpeta SET DEFAULT nextval('tipodocumentocarpeta_idtipodocumentocarpeta_seq'::regclass);


--
-- TOC entry 7426 (class 2604 OID 89178)
-- Dependencies: 815 812
-- Name: idtipodocumentocompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentocompulsacion ALTER COLUMN idtipodocumentocompulsacion SET DEFAULT nextval('tipodocumentocompulsacion_idtipodocumentocompulsacion_seq'::regclass);


--
-- TOC entry 7427 (class 2604 OID 89179)
-- Dependencies: 814 813
-- Name: idtipodocumentocompulsacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentocompulsacion_audit ALTER COLUMN idtipodocumentocompulsacion SET DEFAULT nextval('tipodocumentocompulsacion_audit_idtipodocumentocompulsacion_seq'::regclass);


--
-- TOC entry 7428 (class 2604 OID 89180)
-- Dependencies: 817 816
-- Name: idtipodocumentoedictoemplazatorio; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentoedictoemplazatorio ALTER COLUMN idtipodocumentoedictoemplazatorio SET DEFAULT nextval('tipodocumentoedictoemplazator_idtipodocumentoedictoemplazat_seq'::regclass);


--
-- TOC entry 7432 (class 2604 OID 89181)
-- Dependencies: 824 822
-- Name: idtipodocumentopersona; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentopersona ALTER COLUMN idtipodocumentopersona SET DEFAULT nextval('tipodocumentopersona_idtipodocumentopersona_seq'::regclass);


--
-- TOC entry 7433 (class 2604 OID 89182)
-- Dependencies: 827 825
-- Name: idtipodocumentopostulacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentopostulacion ALTER COLUMN idtipodocumentopostulacion SET DEFAULT nextval('tipodocumentopostulacion_idtipodocumentopostulacion_seq'::regclass);


--
-- TOC entry 7434 (class 2604 OID 89183)
-- Dependencies: 829 828
-- Name: idtipodocumentotitularidadbien; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentotitularidadbien ALTER COLUMN idtipodocumentotitularidadbien SET DEFAULT nextval('tipodocumentotitularidadbien_idtipodocumentotitularidadbien_seq'::regclass);


--
-- TOC entry 7435 (class 2604 OID 89184)
-- Dependencies: 832 830
-- Name: idtipoedad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoedad ALTER COLUMN idtipoedad SET DEFAULT nextval('tipoedad_idtipoedad_seq'::regclass);


--
-- TOC entry 7436 (class 2604 OID 89185)
-- Dependencies: 835 833
-- Name: idtipoestadonotificacioncorreo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoestadonotificacioncorreo ALTER COLUMN idtipoestadonotificacioncorreo SET DEFAULT nextval('tipoestadonotificacioncorreo_idtipoestadonotificacioncorreo_seq'::regclass);


--
-- TOC entry 7438 (class 2604 OID 89186)
-- Dependencies: 840 838
-- Name: idtipofecha; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipofecha ALTER COLUMN idtipofecha SET DEFAULT nextval('tipofecha_idtipofecha_seq'::regclass);


--
-- TOC entry 7439 (class 2604 OID 89187)
-- Dependencies: 844 841
-- Name: idtipofenomenohistorico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipofenomenohistorico ALTER COLUMN idtipofenomenohistorico SET DEFAULT nextval('tipofenomenohistorico_idtipofenomenohistorico_seq'::regclass);


--
-- TOC entry 7440 (class 2604 OID 89188)
-- Dependencies: 843 842
-- Name: idtipofenomenohistorico; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipofenomenohistorico_audit ALTER COLUMN idtipofenomenohistorico SET DEFAULT nextval('tipofenomenohistorico_audit_idtipofenomenohistorico_seq'::regclass);


--
-- TOC entry 7441 (class 2604 OID 89189)
-- Dependencies: 847 845
-- Name: idtipohechoversion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohechoversion ALTER COLUMN idtipohechoversion SET DEFAULT nextval('tipohechoversion_idtipohechoversion_seq'::regclass);


--
-- TOC entry 7442 (class 2604 OID 89190)
-- Dependencies: 850 848
-- Name: idtipohistorialreclusion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohistorialreclusion ALTER COLUMN idtipohistorialreclusion SET DEFAULT nextval('tipohistorialreclusion_idtipohistorialreclusion_seq'::regclass);


--
-- TOC entry 7443 (class 2604 OID 89191)
-- Dependencies: 853 851
-- Name: idtipoidentificaciongrupoarmado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoidentificaciongrupoarmado ALTER COLUMN idtipoidentificaciongrupoarmado SET DEFAULT nextval('tipoidentificaciongrupoarmado_idtipoidentificaciongrupoarma_seq'::regclass);


--
-- TOC entry 7444 (class 2604 OID 89192)
-- Dependencies: 856 854
-- Name: idtipoinactivopostulado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoinactivopostulado ALTER COLUMN idtipoinactivopostulado SET DEFAULT nextval('tipoinactivopostulado_idtipoinactivopostulado_seq'::regclass);


--
-- TOC entry 7445 (class 2604 OID 89193)
-- Dependencies: 861 859
-- Name: idtipoley; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoley ALTER COLUMN idtipoley SET DEFAULT nextval('tipoley_idtipoley_seq'::regclass);


--
-- TOC entry 7446 (class 2604 OID 89194)
-- Dependencies: 864 862
-- Name: idtipomediopublicacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipomediopublicacion ALTER COLUMN idtipomediopublicacion SET DEFAULT nextval('tipomediopublicacion_idtipomediopublicacion_seq'::regclass);


--
-- TOC entry 7447 (class 2604 OID 89195)
-- Dependencies: 867 865
-- Name: idtipomoneda; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipomoneda ALTER COLUMN idtipomoneda SET DEFAULT nextval('tipomoneda_idtipomoneda_seq'::regclass);


--
-- TOC entry 7448 (class 2604 OID 89196)
-- Dependencies: 870 868
-- Name: idtiponivelsisben; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiponivelsisben ALTER COLUMN idtiponivelsisben SET DEFAULT nextval('tiponivelsisben_idtiponivelsisben_seq'::regclass);


--
-- TOC entry 7449 (class 2604 OID 89197)
-- Dependencies: 873 871
-- Name: idtipoorigenfuenteinformacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoorigenfuenteinformacion ALTER COLUMN idtipoorigenfuenteinformacion SET DEFAULT nextval('tipoorigenfuenteinformacion_idtipoorigenfuenteinformacion_seq'::regclass);


--
-- TOC entry 7450 (class 2604 OID 89198)
-- Dependencies: 876 874
-- Name: idtipoparticipacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoparticipacion ALTER COLUMN idtipoparticipacion SET DEFAULT nextval('tipoparticipacion_idtipoparticipacion_seq'::regclass);


--
-- TOC entry 7451 (class 2604 OID 89199)
-- Dependencies: 879 877
-- Name: idtipoparticipanteaudiencia; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoparticipanteaudiencia ALTER COLUMN idtipoparticipanteaudiencia SET DEFAULT nextval('tipoparticipanteaudiencia_idtipoparticipanteaudiencia_seq'::regclass);


--
-- TOC entry 7452 (class 2604 OID 89200)
-- Dependencies: 882 880
-- Name: idtipoperfilfotopersona; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoperfilfotopersona ALTER COLUMN idtipoperfilfotopersona SET DEFAULT nextval('tipoperfilfotopersona_idtipoperfilfotopersona_seq'::regclass);


--
-- TOC entry 7454 (class 2604 OID 89201)
-- Dependencies: 887 885
-- Name: idtipopostulado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipopostulado ALTER COLUMN idtipopostulado SET DEFAULT nextval('tipopostulado_idtipopostulado_seq'::regclass);


--
-- TOC entry 7455 (class 2604 OID 89202)
-- Dependencies: 890 888
-- Name: idtipopreclusionpostulado; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipopreclusionpostulado ALTER COLUMN idtipopreclusionpostulado SET DEFAULT nextval('tipopreclusionpostulado_idtipopreclusionpostulado_seq'::regclass);


--
-- TOC entry 7456 (class 2604 OID 89203)
-- Dependencies: 893 891
-- Name: idtipoprocesojyp; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoprocesojyp ALTER COLUMN idtipoprocesojyp SET DEFAULT nextval('tipoprocesojyp_idtipoprocesojyp_seq'::regclass);


--
-- TOC entry 7457 (class 2604 OID 89204)
-- Dependencies: 896 894
-- Name: idtiporangoedad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporangoedad ALTER COLUMN idtiporangoedad SET DEFAULT nextval('tiporangoedad_idtiporangoedad_seq'::regclass);


--
-- TOC entry 7458 (class 2604 OID 89205)
-- Dependencies: 899 897
-- Name: idtiporelacionevento; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporelacionevento ALTER COLUMN idtiporelacionevento SET DEFAULT nextval('tiporelacionevento_idtiporelacionevento_seq'::regclass);


--
-- TOC entry 7461 (class 2604 OID 89206)
-- Dependencies: 903 902
-- Name: idtiporelacionpersonajuridicacolectividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporelacionpersonajuridicacolectividad ALTER COLUMN idtiporelacionpersonajuridicacolectividad SET DEFAULT nextval('tiporelacionpersonajuridicaco_idtiporelacionpersonajuridica_seq'::regclass);


--
-- TOC entry 7462 (class 2604 OID 89207)
-- Dependencies: 907 905
-- Name: idtiposectortrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiposectortrabajo ALTER COLUMN idtiposectortrabajo SET DEFAULT nextval('tiposectortrabajo_idtiposectortrabajo_seq'::regclass);


--
-- TOC entry 7463 (class 2604 OID 89208)
-- Dependencies: 909 908
-- Name: idtiposubclasificacionpersonajuridica; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiposubclasificacionpersonajuridica ALTER COLUMN idtiposubclasificacionpersonajuridica SET DEFAULT nextval('tiposubclasificacionpersonaju_idtiposubclasificacionpersona_seq'::regclass);


--
-- TOC entry 7464 (class 2604 OID 89209)
-- Dependencies: 913 911
-- Name: idtipoterminacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoterminacionprocesopostulado ALTER COLUMN idtipoterminacion SET DEFAULT nextval('tipoterminacionprocesopostulado_idtipoterminacion_seq'::regclass);


--
-- TOC entry 7465 (class 2604 OID 89210)
-- Dependencies: 915 914
-- Name: idtipotitular; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipotitular ALTER COLUMN idtipotitular SET DEFAULT nextval('tipotitular_idtipotitular_seq'::regclass);


--
-- TOC entry 7466 (class 2604 OID 89211)
-- Dependencies: 919 916
-- Name: idtipotrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipotrabajo ALTER COLUMN idtipotrabajo SET DEFAULT nextval('tipotrabajo_idtipotrabajo_seq'::regclass);


--
-- TOC entry 7467 (class 2604 OID 89212)
-- Dependencies: 918 917
-- Name: idtipotrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipotrabajo_audit ALTER COLUMN idtipotrabajo SET DEFAULT nextval('tipotrabajo_audit_idtipotrabajo_seq'::regclass);


--
-- TOC entry 7468 (class 2604 OID 89213)
-- Dependencies: 923 920
-- Name: idtipoubicacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoubicacion ALTER COLUMN idtipoubicacion SET DEFAULT nextval('tipoubicacion_idtipoubicacion_seq'::regclass);


--
-- TOC entry 7469 (class 2604 OID 89214)
-- Dependencies: 922 921
-- Name: idtipoubicacion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoubicacion_audit ALTER COLUMN idtipoubicacion SET DEFAULT nextval('tipoubicacion_audit_idtipoubicacion_seq'::regclass);


--
-- TOC entry 7470 (class 2604 OID 89215)
-- Dependencies: 926 924
-- Name: idtipoubicacioncuerpo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoubicacioncuerpo ALTER COLUMN idtipoubicacioncuerpo SET DEFAULT nextval('tipoubicacioncuerpo_idtipoubicacioncuerpo_seq'::regclass);


--
-- TOC entry 7471 (class 2604 OID 89216)
-- Dependencies: 931 929
-- Name: idtrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo ALTER COLUMN idtrabajo SET DEFAULT nextval('trabajo_idtrabajo_seq'::regclass);


--
-- TOC entry 7472 (class 2604 OID 89217)
-- Dependencies: 934 932
-- Name: idtipoubicacioncuerpo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo ALTER COLUMN idtipoubicacioncuerpo SET DEFAULT nextval('ubicacioncuerpo_idtipoubicacioncuerpo_seq'::regclass);


--
-- TOC entry 7473 (class 2604 OID 89218)
-- Dependencies: 936 935
-- Name: idunificacioncarpeta; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacioncarpeta ALTER COLUMN idunificacioncarpeta SET DEFAULT nextval('unificacioncarpeta_idunificacioncarpeta_seq'::regclass);


--
-- TOC entry 7475 (class 2604 OID 89219)
-- Dependencies: 938 937
-- Name: idunificacionpersona; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacionpersona ALTER COLUMN idunificacionpersona SET DEFAULT nextval('unificacionpersona_idunificacionpersona_seq'::regclass);


--
-- TOC entry 7476 (class 2604 OID 89220)
-- Dependencies: 942 940
-- Name: idversion; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY version ALTER COLUMN idversion SET DEFAULT nextval('version_idversion_seq'::regclass);


--
-- TOC entry 7491 (class 2606 OID 89224)
-- Dependencies: 335 335 8870
-- Name: acta_asignacion_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_uniq UNIQUE (idacta);


--
-- TOC entry 7497 (class 2606 OID 89226)
-- Dependencies: 346 346 8870
-- Name: albumfotografico_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT albumfotografico_uniq UNIQUE (idalbumfotografico);


--
-- TOC entry 7500 (class 2606 OID 89228)
-- Dependencies: 364 364 8870
-- Name: audiencia_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY audiencia
    ADD CONSTRAINT audiencia_uniq UNIQUE (idaudiencia);


--
-- TOC entry 7504 (class 2606 OID 89230)
-- Dependencies: 368 368 8870
-- Name: autoridad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY autoridad
    ADD CONSTRAINT autoridad_pkey PRIMARY KEY (idautoridad);


--
-- TOC entry 7508 (class 2606 OID 89232)
-- Dependencies: 372 372 372 8870
-- Name: bienesentregadospk_1; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bienesentregadosdesmovilizacion
    ADD CONSTRAINT bienesentregadospk_1 PRIMARY KEY (idbien, iddesmovilizacion);


--
-- TOC entry 7506 (class 2606 OID 89234)
-- Dependencies: 370 370 8870
-- Name: bienpk_1; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienpk_1 PRIMARY KEY (idbien);


--
-- TOC entry 7510 (class 2606 OID 89236)
-- Dependencies: 375 375 8870
-- Name: bloque_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bloque
    ADD CONSTRAINT bloque_pkey PRIMARY KEY (idbloque);


--
-- TOC entry 7512 (class 2606 OID 89238)
-- Dependencies: 377 377 8870
-- Name: calidadvictima_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY calidadvictima
    ADD CONSTRAINT calidadvictima_pkey PRIMARY KEY (idcalidadvictima);


--
-- TOC entry 7514 (class 2606 OID 89240)
-- Dependencies: 378 378 378 8870
-- Name: caracteristica_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY caracteristica
    ADD CONSTRAINT caracteristica_pk PRIMARY KEY (idcaracteristica, idbien);


--
-- TOC entry 7516 (class 2606 OID 89242)
-- Dependencies: 381 381 8870
-- Name: cargo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cargo
    ADD CONSTRAINT cargo_pkey PRIMARY KEY (idcargo);


--
-- TOC entry 7518 (class 2606 OID 89244)
-- Dependencies: 382 382 8870
-- Name: carpetahecho_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT carpetahecho_pk PRIMARY KEY (idcarpetahecho);


--
-- TOC entry 7520 (class 2606 OID 89246)
-- Dependencies: 385 385 8870
-- Name: causaterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY causaterminacionprocesopostulado
    ADD CONSTRAINT causaterminacionprocesopostulado_pkey PRIMARY KEY (idcausaterminacion);


--
-- TOC entry 7522 (class 2606 OID 89248)
-- Dependencies: 389 389 8870
-- Name: clasedesmovilizacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY clasedesmovilizacion
    ADD CONSTRAINT clasedesmovilizacion_pkey PRIMARY KEY (idclasedesmovilizacion);


--
-- TOC entry 7526 (class 2606 OID 89250)
-- Dependencies: 394 394 8870
-- Name: connotacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY connotacion
    ADD CONSTRAINT connotacion_pk PRIMARY KEY (idconnotacion);


--
-- TOC entry 7528 (class 2606 OID 89252)
-- Dependencies: 397 397 397 397 8870
-- Name: controlregistrohechos_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY controlregistrohechos
    ADD CONSTRAINT controlregistrohechos_pk PRIMARY KEY (idregistrohecho, idautoridad, fecha);


--
-- TOC entry 7530 (class 2606 OID 89254)
-- Dependencies: 400 400 8870
-- Name: datosbasicos_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY datosbasicos
    ADD CONSTRAINT datosbasicos_pk PRIMARY KEY (nombretabla);


--
-- TOC entry 7533 (class 2606 OID 89256)
-- Dependencies: 404 404 8870
-- Name: decisionterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_pkey PRIMARY KEY (iddecisionterminacion);


--
-- TOC entry 7535 (class 2606 OID 89258)
-- Dependencies: 408 408 8870
-- Name: delito_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY delito
    ADD CONSTRAINT delito_pkey PRIMARY KEY (iddelito);


--
-- TOC entry 7537 (class 2606 OID 89260)
-- Dependencies: 410 410 410 8870
-- Name: denunciaadicional_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY denunciaadicional
    ADD CONSTRAINT denunciaadicional_pkey PRIMARY KEY (idautoridad, idevento);


--
-- TOC entry 7539 (class 2606 OID 89262)
-- Dependencies: 413 413 8870
-- Name: departamento_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY departamento
    ADD CONSTRAINT departamento_pkey PRIMARY KEY (iddepartamento);


--
-- TOC entry 7541 (class 2606 OID 89264)
-- Dependencies: 414 414 8870
-- Name: desmovilizacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacion_pkey PRIMARY KEY (iddesmovilizacion);


--
-- TOC entry 7543 (class 2606 OID 89266)
-- Dependencies: 417 417 417 8870
-- Name: desmovilizado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY desmovilizado
    ADD CONSTRAINT desmovilizado_pkey PRIMARY KEY (idpersona, iddesmovilizacion);


--
-- TOC entry 7545 (class 2606 OID 89268)
-- Dependencies: 419 419 8870
-- Name: despacho_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY despacho
    ADD CONSTRAINT despacho_pk PRIMARY KEY (iddespacho);


--
-- TOC entry 7547 (class 2606 OID 89270)
-- Dependencies: 422 422 8870
-- Name: documento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT documento_pk PRIMARY KEY (iddocumento);


--
-- TOC entry 7551 (class 2606 OID 89272)
-- Dependencies: 428 428 8870
-- Name: documentocompulsacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentocompulsacion
    ADD CONSTRAINT documentocompulsacion_pk PRIMARY KEY (iddocumentocompulsacion);


--
-- TOC entry 7553 (class 2606 OID 89274)
-- Dependencies: 432 432 8870
-- Name: documentocuerpotipoacta_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentocuerpotipoacta
    ADD CONSTRAINT documentocuerpotipoacta_pkey PRIMARY KEY (iddocumentocuerpotipoacta);


--
-- TOC entry 7555 (class 2606 OID 89276)
-- Dependencies: 434 434 8870
-- Name: documentoedictoemplazatorio_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentoedictoemplazatorio
    ADD CONSTRAINT documentoedictoemplazatorio_pkey PRIMARY KEY (iddocumentoedictoemplazatorio);


--
-- TOC entry 7557 (class 2606 OID 89278)
-- Dependencies: 437 437 8870
-- Name: documentopersona_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT documentopersona_pk PRIMARY KEY (iddocumentopersona);


--
-- TOC entry 7561 (class 2606 OID 89280)
-- Dependencies: 443 443 8870
-- Name: documentospostulacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentospostulacion
    ADD CONSTRAINT documentospostulacion_pkey PRIMARY KEY (iddocumentospostulacion);


--
-- TOC entry 7563 (class 2606 OID 89282)
-- Dependencies: 446 446 8870
-- Name: documentotipoacta_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentotipoacta
    ADD CONSTRAINT documentotipoacta_pkey PRIMARY KEY (iddocumentoacta);


--
-- TOC entry 7565 (class 2606 OID 89284)
-- Dependencies: 448 448 8870
-- Name: elemento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY elemento
    ADD CONSTRAINT elemento_pk PRIMARY KEY (idelemento);


--
-- TOC entry 7567 (class 2606 OID 89286)
-- Dependencies: 451 451 8870
-- Name: estadocivil_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estadocivil
    ADD CONSTRAINT estadocivil_pkey PRIMARY KEY (idestadocivil);


--
-- TOC entry 7569 (class 2606 OID 89288)
-- Dependencies: 452 452 8870
-- Name: estadoetapaproceso_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estadoetapaproceso
    ADD CONSTRAINT estadoetapaproceso_pk PRIMARY KEY (idestadoetapaproceso);


--
-- TOC entry 7575 (class 2606 OID 89290)
-- Dependencies: 461 461 8870
-- Name: estadoreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estadoprogramacionreporte
    ADD CONSTRAINT estadoreporte_pk PRIMARY KEY (idestadoprogramacionreporte);


--
-- TOC entry 7577 (class 2606 OID 89292)
-- Dependencies: 465 465 8870
-- Name: estructura_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estructura
    ADD CONSTRAINT estructura_pkey PRIMARY KEY (idestructura);


--
-- TOC entry 7583 (class 2606 OID 89294)
-- Dependencies: 472 472 8870
-- Name: etapaproceso_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY etapaproceso
    ADD CONSTRAINT etapaproceso_pk PRIMARY KEY (idetapaproceso);


--
-- TOC entry 7594 (class 2606 OID 89296)
-- Dependencies: 485 485 8870
-- Name: fotos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY fotos
    ADD CONSTRAINT fotos_pkey PRIMARY KEY (idfoto);


--
-- TOC entry 7596 (class 2606 OID 89298)
-- Dependencies: 488 488 8870
-- Name: frente_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY frente
    ADD CONSTRAINT frente_pkey PRIMARY KEY (idfrente);


--
-- TOC entry 7598 (class 2606 OID 89300)
-- Dependencies: 490 490 8870
-- Name: fuenteinformacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY fuenteinformacion
    ADD CONSTRAINT fuenteinformacion_pkey PRIMARY KEY (idfuenteinformacion);


--
-- TOC entry 7602 (class 2606 OID 89302)
-- Dependencies: 497 497 8870
-- Name: funcion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY funcion
    ADD CONSTRAINT funcion_pkey PRIMARY KEY (idfuncion);


--
-- TOC entry 7604 (class 2606 OID 89304)
-- Dependencies: 499 499 8870
-- Name: genero_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY genero
    ADD CONSTRAINT genero_pkey PRIMARY KEY (idgenero);


--
-- TOC entry 7606 (class 2606 OID 89306)
-- Dependencies: 500 500 8870
-- Name: genesisgrupoarmado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_pkey PRIMARY KEY (idgenesisgrupoarmado);


--
-- TOC entry 7608 (class 2606 OID 89308)
-- Dependencies: 504 504 504 504 504 504 504 504 504 504 8870
-- Name: georeferenciacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT georeferenciacion_pk PRIMARY KEY (idpais, iddepartamento, idmunicipio, idgrupoarmado, idestructura, idbloque, idfrente, fechainicio, fechafin);


--
-- TOC entry 7610 (class 2606 OID 89310)
-- Dependencies: 506 506 8870
-- Name: georeferenciaciongrupoarmado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_pkey PRIMARY KEY (idgeoreferenciaciongrupoarmado);


--
-- TOC entry 7612 (class 2606 OID 89312)
-- Dependencies: 510 510 8870
-- Name: grupoarmado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY grupoarmado
    ADD CONSTRAINT grupoarmado_pkey PRIMARY KEY (idgrupoarmado);


--
-- TOC entry 7614 (class 2606 OID 89314)
-- Dependencies: 511 511 8870
-- Name: grupos_etnicos_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY grupos_etnicos
    ADD CONSTRAINT grupos_etnicos_pk PRIMARY KEY (idgrupos_etnicos);


--
-- TOC entry 7616 (class 2606 OID 89316)
-- Dependencies: 515 515 8870
-- Name: gruposanguineo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY gruposanguineo
    ADD CONSTRAINT gruposanguineo_pkey PRIMARY KEY (idgruposanguineo);


--
-- TOC entry 7619 (class 2606 OID 89318)
-- Dependencies: 516 516 8870
-- Name: hechopk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT hechopk PRIMARY KEY (idhecho);


--
-- TOC entry 7621 (class 2606 OID 89320)
-- Dependencies: 520 520 8870
-- Name: historial_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historial_pkey PRIMARY KEY (idhistorial);


--
-- TOC entry 7623 (class 2606 OID 89322)
-- Dependencies: 522 522 8870
-- Name: historialreclusion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_pkey PRIMARY KEY (idhistorialreclusion);


--
-- TOC entry 7625 (class 2606 OID 89324)
-- Dependencies: 526 526 8870
-- Name: historialubicacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicacion_pkey PRIMARY KEY (idhistorial);


--
-- TOC entry 7493 (class 2606 OID 89326)
-- Dependencies: 340 340 8870
-- Name: idactividadfuenteinformacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY actividadfuenteinformacion
    ADD CONSTRAINT idactividadfuenteinformacion_pk PRIMARY KEY (idactividadfuenteinformacion);


--
-- TOC entry 7502 (class 2606 OID 89328)
-- Dependencies: 364 364 8870
-- Name: idaudiencia_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY audiencia
    ADD CONSTRAINT idaudiencia_uniq UNIQUE (idaudiencia);


--
-- TOC entry 7524 (class 2606 OID 89330)
-- Dependencies: 391 391 8870
-- Name: idcompulsacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY compulsacion
    ADD CONSTRAINT idcompulsacion_pk PRIMARY KEY (idcompulsacion);


--
-- TOC entry 7549 (class 2606 OID 89332)
-- Dependencies: 425 425 8870
-- Name: iddocumentocarpeta_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentocarpeta
    ADD CONSTRAINT iddocumentocarpeta_pk PRIMARY KEY (iddocumentocarpeta);


--
-- TOC entry 7559 (class 2606 OID 89334)
-- Dependencies: 440 440 8870
-- Name: iddocumentopostulacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documentopostulacion
    ADD CONSTRAINT iddocumentopostulacion_pk PRIMARY KEY (iddocumentopostulacion);


--
-- TOC entry 7771 (class 2606 OID 89336)
-- Dependencies: 711 711 711 8870
-- Name: iddocumentopostulacion_radicado_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpostuladodocumentopostulacion
    ADD CONSTRAINT iddocumentopostulacion_radicado_pk PRIMARY KEY (iddocumentopostulacion, radicado);


--
-- TOC entry 7629 (class 2606 OID 89338)
-- Dependencies: 534 534 8870
-- Name: identificacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY identificacion
    ADD CONSTRAINT identificacion_pk PRIMARY KEY (ididentificacion);


--
-- TOC entry 7631 (class 2606 OID 89340)
-- Dependencies: 537 537 8870
-- Name: identificaciongrupoarmado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_pkey PRIMARY KEY (ididentificaciongrupoarmado);


--
-- TOC entry 7571 (class 2606 OID 89342)
-- Dependencies: 455 455 8870
-- Name: idestadohistoricoprocesal_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estadohistoricoprocesal
    ADD CONSTRAINT idestadohistoricoprocesal_pk PRIMARY KEY (idestadohistoricoprocesal);


--
-- TOC entry 7573 (class 2606 OID 89344)
-- Dependencies: 458 458 8870
-- Name: idestadopostulado_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estadopostulado
    ADD CONSTRAINT idestadopostulado_pk PRIMARY KEY (idestadopostulado);


--
-- TOC entry 7579 (class 2606 OID 89346)
-- Dependencies: 466 466 8870
-- Name: idetapaflujoinformacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY etapaflujoinformacion
    ADD CONSTRAINT idetapaflujoinformacion_pk PRIMARY KEY (idetapaflujoinformacion);


--
-- TOC entry 7581 (class 2606 OID 89348)
-- Dependencies: 469 469 8870
-- Name: idetapahistoricoprocesal_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY etapahistoricoprocesal
    ADD CONSTRAINT idetapahistoricoprocesal_pk PRIMARY KEY (idetapahistoricoprocesal);


--
-- TOC entry 7735 (class 2606 OID 89350)
-- Dependencies: 673 673 673 8870
-- Name: ideventomodusoperandi_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioneventomodusoperandi
    ADD CONSTRAINT ideventomodusoperandi_pk PRIMARY KEY (idevento, idmodusoperandi);


--
-- TOC entry 7588 (class 2606 OID 89352)
-- Dependencies: 475 475 8870
-- Name: ideventopk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT ideventopk PRIMARY KEY (idevento);


--
-- TOC entry 7590 (class 2606 OID 89354)
-- Dependencies: 478 478 8870
-- Name: idfactoringresoga_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY factoringresoga
    ADD CONSTRAINT idfactoringresoga_pk PRIMARY KEY (idfactoringresoga);


--
-- TOC entry 7592 (class 2606 OID 89356)
-- Dependencies: 482 482 8870
-- Name: idformatoreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY formatoreporte
    ADD CONSTRAINT idformatoreporte_pk PRIMARY KEY (idformatoreporte);


--
-- TOC entry 7600 (class 2606 OID 89358)
-- Dependencies: 492 492 8870
-- Name: idfuenteinformacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idfuenteinformacion_pk PRIMARY KEY (idfuenteinformacion);


--
-- TOC entry 7627 (class 2606 OID 89360)
-- Dependencies: 530 530 8870
-- Name: idhistoricoprocesal; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT idhistoricoprocesal PRIMARY KEY (idhistoricoprocesal);


--
-- TOC entry 7495 (class 2606 OID 89362)
-- Dependencies: 343 343 8870
-- Name: idhistoricoprocesaldecision_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY actuacionhistoricoprocesal
    ADD CONSTRAINT idhistoricoprocesaldecision_pk PRIMARY KEY (idhistoricoprocesaldecision);


--
-- TOC entry 7655 (class 2606 OID 89364)
-- Dependencies: 573 573 8870
-- Name: idnotificacioncorreo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY notificacioncorreo
    ADD CONSTRAINT idnotificacioncorreo_pk PRIMARY KEY (idnotificacioncorreo);


--
-- TOC entry 7661 (class 2606 OID 89366)
-- Dependencies: 581 581 8870
-- Name: idorigenfuenteinformacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY origenfuenteinformacion
    ADD CONSTRAINT idorigenfuenteinformacion_pk PRIMARY KEY (idorigenfuenteinformacion);


--
-- TOC entry 7699 (class 2606 OID 89368)
-- Dependencies: 635 635 8870
-- Name: idregistrohecho; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT idregistrohecho PRIMARY KEY (idregistrohecho);


--
-- TOC entry 7723 (class 2606 OID 89370)
-- Dependencies: 661 661 661 8870
-- Name: idrelacioncompulsacionhistoricoprocesal_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioncompulsacionhistoricoprocesal
    ADD CONSTRAINT idrelacioncompulsacionhistoricoprocesal_pk PRIMARY KEY (idcompulsacion, idhistoricoprocesal);


--
-- TOC entry 7733 (class 2606 OID 89372)
-- Dependencies: 671 671 671 8870
-- Name: idrelacioneventofuenteinfo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioneventofuenteinfo
    ADD CONSTRAINT idrelacioneventofuenteinfo_pk PRIMARY KEY (idevento, idfuenteinformacion);


--
-- TOC entry 7753 (class 2606 OID 89374)
-- Dependencies: 691 691 691 8870
-- Name: idrelacionhistoricoprocesalfuenteinfo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionhistoricoprocesalfuenteinfo
    ADD CONSTRAINT idrelacionhistoricoprocesalfuenteinfo_pk PRIMARY KEY (idhistoricoprocesal, idfuenteinformacion);


--
-- TOC entry 7765 (class 2606 OID 89376)
-- Dependencies: 703 703 703 8870
-- Name: idrelacionpersonacompulsacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpersonacompulsacion
    ADD CONSTRAINT idrelacionpersonacompulsacion_pk PRIMARY KEY (idpersona, idcompulsacion);


--
-- TOC entry 7793 (class 2606 OID 89378)
-- Dependencies: 734 734 8870
-- Name: idreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reporte
    ADD CONSTRAINT idreporte_pk PRIMARY KEY (idreporte);


--
-- TOC entry 7823 (class 2606 OID 89380)
-- Dependencies: 772 772 8870
-- Name: idtipoactuacionhistoricoprocesal_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoactuacionhistoricoprocesal
    ADD CONSTRAINT idtipoactuacionhistoricoprocesal_pk PRIMARY KEY (idtipoactuacionhistoricoprocesal);


--
-- TOC entry 7841 (class 2606 OID 89382)
-- Dependencies: 798 798 8870
-- Name: idtipocompulsacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipocompulsacion
    ADD CONSTRAINT idtipocompulsacion_pk PRIMARY KEY (idtipocompulsacion);


--
-- TOC entry 7849 (class 2606 OID 89384)
-- Dependencies: 809 809 8870
-- Name: idtipodocumentocarpeta_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentocarpeta
    ADD CONSTRAINT idtipodocumentocarpeta_pk PRIMARY KEY (idtipodocumentocarpeta);


--
-- TOC entry 7859 (class 2606 OID 89386)
-- Dependencies: 825 825 8870
-- Name: idtipodocumentopostulacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentopostulacion
    ADD CONSTRAINT idtipodocumentopostulacion_pk PRIMARY KEY (idtipodocumentopostulacion);


--
-- TOC entry 7865 (class 2606 OID 89388)
-- Dependencies: 833 833 8870
-- Name: idtipoestadonotificacioncorreo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoestadonotificacioncorreo
    ADD CONSTRAINT idtipoestadonotificacioncorreo_pk PRIMARY KEY (idtipoestadonotificacioncorreo);


--
-- TOC entry 7883 (class 2606 OID 89390)
-- Dependencies: 859 859 8870
-- Name: idtipoley_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoley
    ADD CONSTRAINT idtipoley_pk PRIMARY KEY (idtipoley);


--
-- TOC entry 7891 (class 2606 OID 89392)
-- Dependencies: 871 871 8870
-- Name: idtipoorigenfuenteinformacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoorigenfuenteinformacion
    ADD CONSTRAINT idtipoorigenfuenteinformacion_pk PRIMARY KEY (idtipoorigenfuenteinformacion);


--
-- TOC entry 7901 (class 2606 OID 89394)
-- Dependencies: 885 885 8870
-- Name: idtipopostulado_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipopostulado
    ADD CONSTRAINT idtipopostulado_pk PRIMARY KEY (idtipopostulado);


--
-- TOC entry 7909 (class 2606 OID 89396)
-- Dependencies: 897 897 8870
-- Name: idtiporelacionevento; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiporelacionevento
    ADD CONSTRAINT idtiporelacionevento PRIMARY KEY (idtiporelacionevento);


--
-- TOC entry 7923 (class 2606 OID 89398)
-- Dependencies: 916 916 8870
-- Name: idtipotrabajo_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipotrabajo
    ADD CONSTRAINT idtipotrabajo_uniq UNIQUE (idtipotrabajo);


--
-- TOC entry 7927 (class 2606 OID 89400)
-- Dependencies: 924 924 8870
-- Name: idtipoubicacioncuerpo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoubicacioncuerpo
    ADD CONSTRAINT idtipoubicacioncuerpo_pk PRIMARY KEY (idtipoubicacioncuerpo);


--
-- TOC entry 7633 (class 2606 OID 89402)
-- Dependencies: 540 540 8870
-- Name: jornadaaudiencia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY jornadaaudiencia
    ADD CONSTRAINT jornadaaudiencia_pkey PRIMARY KEY (idjornadaaudiencia);


--
-- TOC entry 7635 (class 2606 OID 89404)
-- Dependencies: 543 543 8870
-- Name: listacaracteristica_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY listacaracteristica
    ADD CONSTRAINT listacaracteristica_pk PRIMARY KEY (idcaracteristica);


--
-- TOC entry 7479 (class 2606 OID 89406)
-- Dependencies: 326 326 8870
-- Name: magistrado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY magistrado
    ADD CONSTRAINT magistrado_pkey PRIMARY KEY (idmagistrado);


--
-- TOC entry 7637 (class 2606 OID 89408)
-- Dependencies: 548 548 8870
-- Name: mediopublicacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY mediopublicacion
    ADD CONSTRAINT mediopublicacion_pkey PRIMARY KEY (idmediopublicacion);


--
-- TOC entry 7639 (class 2606 OID 89410)
-- Dependencies: 552 552 8870
-- Name: menu_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY menu
    ADD CONSTRAINT menu_pkey PRIMARY KEY (idmenu);


--
-- TOC entry 7641 (class 2606 OID 89412)
-- Dependencies: 554 554 8870
-- Name: modusoperandi_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY modusoperandi
    ADD CONSTRAINT modusoperandi_pk PRIMARY KEY (idmodusoperandi);


--
-- TOC entry 7643 (class 2606 OID 89414)
-- Dependencies: 557 557 8870
-- Name: motivoterminacionetapapostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY motivoterminacionetapapostulado
    ADD CONSTRAINT motivoterminacionetapapostulado_pkey PRIMARY KEY (idmotivoterminacionetapapostulado);


--
-- TOC entry 7645 (class 2606 OID 89416)
-- Dependencies: 560 560 8870
-- Name: movil_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY movil
    ADD CONSTRAINT movil_pk PRIMARY KEY (idmovil);


--
-- TOC entry 7647 (class 2606 OID 89418)
-- Dependencies: 564 564 8870
-- Name: municipio_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY municipio
    ADD CONSTRAINT municipio_pkey PRIMARY KEY (idmunicipio);


--
-- TOC entry 7649 (class 2606 OID 89420)
-- Dependencies: 565 565 8870
-- Name: nivel_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY nivel
    ADD CONSTRAINT nivel_pk PRIMARY KEY (idnivel);


--
-- TOC entry 7651 (class 2606 OID 89422)
-- Dependencies: 569 569 8870
-- Name: niveleducacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY niveleducacion
    ADD CONSTRAINT niveleducacion_pkey PRIMARY KEY (idniveleducacion);


--
-- TOC entry 7653 (class 2606 OID 89424)
-- Dependencies: 570 570 8870
-- Name: notificacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT notificacion_pk PRIMARY KEY (idnotificacion);


--
-- TOC entry 7657 (class 2606 OID 89426)
-- Dependencies: 576 576 8870
-- Name: origen_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY origen
    ADD CONSTRAINT origen_pk PRIMARY KEY (idorigen);


--
-- TOC entry 7659 (class 2606 OID 89428)
-- Dependencies: 578 578 8870
-- Name: origenevento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY origenevento
    ADD CONSTRAINT origenevento_pk PRIMARY KEY (idorigenevento);


--
-- TOC entry 7663 (class 2606 OID 89430)
-- Dependencies: 584 584 8870
-- Name: origenhechoversion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY origenhechoversion
    ADD CONSTRAINT origenhechoversion_pk PRIMARY KEY (idorigenhechoversion);


--
-- TOC entry 7665 (class 2606 OID 89432)
-- Dependencies: 588 588 8870
-- Name: pais_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pais
    ADD CONSTRAINT pais_pkey PRIMARY KEY (idpais);


--
-- TOC entry 7667 (class 2606 OID 89434)
-- Dependencies: 589 589 8870
-- Name: partidos_politicos_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY partidos_politicos
    ADD CONSTRAINT partidos_politicos_pk PRIMARY KEY (idpartidos_politicos);


--
-- TOC entry 7669 (class 2606 OID 89436)
-- Dependencies: 593 593 8870
-- Name: perfil_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY perfil
    ADD CONSTRAINT perfil_pkey PRIMARY KEY (idperfil);


--
-- TOC entry 7481 (class 2606 OID 89438)
-- Dependencies: 328 328 8870
-- Name: persona_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT persona_pkey PRIMARY KEY (idpersona);


--
-- TOC entry 7671 (class 2606 OID 89440)
-- Dependencies: 595 595 8870
-- Name: personacambiodeidentidad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_pkey PRIMARY KEY (idpersonacambioidentidad);


--
-- TOC entry 7673 (class 2606 OID 89442)
-- Dependencies: 598 598 8870
-- Name: personaestadohistorico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personaestadohistorico
    ADD CONSTRAINT personaestadohistorico_pkey PRIMARY KEY (idpersonaestadohistorico);


--
-- TOC entry 7675 (class 2606 OID 89444)
-- Dependencies: 601 601 8870
-- Name: personaestadosocioeconomico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_pkey PRIMARY KEY (idpersonaestadosocioeconomico);


--
-- TOC entry 7485 (class 2606 OID 89446)
-- Dependencies: 330 330 8870
-- Name: personajuridicacolectividad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_pkey PRIMARY KEY (idpersonajuridicacolectividad);


--
-- TOC entry 7677 (class 2606 OID 89448)
-- Dependencies: 606 606 8870
-- Name: personajuridicacolectividadcorreo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personajuridicacolectividadcorreo
    ADD CONSTRAINT personajuridicacolectividadcorreo_pkey PRIMARY KEY (idpersonajuridicacolectividadcorreo);


--
-- TOC entry 7487 (class 2606 OID 89450)
-- Dependencies: 331 331 8870
-- Name: postulado_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT postulado_pk PRIMARY KEY (radicado);


--
-- TOC entry 7679 (class 2606 OID 89452)
-- Dependencies: 611 611 8870
-- Name: postuladoasignacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_pkey PRIMARY KEY (idpostuladoasignacion);


--
-- TOC entry 7681 (class 2606 OID 89454)
-- Dependencies: 614 614 614 8870
-- Name: postuladoeventoaudiencia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY postuladoeventoaudiencia
    ADD CONSTRAINT postuladoeventoaudiencia_pkey PRIMARY KEY (radicado, idevento);


--
-- TOC entry 7683 (class 2606 OID 89456)
-- Dependencies: 616 616 8870
-- Name: procedenciausuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY procedenciausuario
    ADD CONSTRAINT procedenciausuario_pkey PRIMARY KEY (idprocedenciausuario);


--
-- TOC entry 7685 (class 2606 OID 89458)
-- Dependencies: 619 619 8870
-- Name: profesion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY profesion
    ADD CONSTRAINT profesion_pkey PRIMARY KEY (idprofesion);


--
-- TOC entry 7687 (class 2606 OID 89460)
-- Dependencies: 620 620 8870
-- Name: programacionreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY programacionreporte
    ADD CONSTRAINT programacionreporte_pk PRIMARY KEY (idprogramacionreporte);


--
-- TOC entry 7689 (class 2606 OID 89462)
-- Dependencies: 623 623 8870
-- Name: publicacionexterna_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY publicacionexterna
    ADD CONSTRAINT publicacionexterna_pkey PRIMARY KEY (idpublicacionexterna);


--
-- TOC entry 7691 (class 2606 OID 89464)
-- Dependencies: 626 626 8870
-- Name: publicacioninterna_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY publicacioninterna
    ADD CONSTRAINT publicacioninterna_pkey PRIMARY KEY (idpublicacioninterna);


--
-- TOC entry 7769 (class 2606 OID 89466)
-- Dependencies: 709 709 709 8870
-- Name: radicado_idacta_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpostuladoacta
    ADD CONSTRAINT radicado_idacta_pk PRIMARY KEY (radicado, idacta);


--
-- TOC entry 7761 (class 2606 OID 89468)
-- Dependencies: 699 699 699 8870
-- Name: radicado_idnotificacioncorreo_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionnotificacioncorreopostulado
    ADD CONSTRAINT radicado_idnotificacioncorreo_pk PRIMARY KEY (radicado, idnotificacioncorreo);


--
-- TOC entry 7693 (class 2606 OID 89470)
-- Dependencies: 630 630 8870
-- Name: rango_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rango
    ADD CONSTRAINT rango_pkey PRIMARY KEY (idrango);


--
-- TOC entry 7695 (class 2606 OID 89472)
-- Dependencies: 631 631 8870
-- Name: raza_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY raza
    ADD CONSTRAINT raza_pk PRIMARY KEY (idraza);


--
-- TOC entry 7697 (class 2606 OID 89474)
-- Dependencies: 634 634 8870
-- Name: regiopk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY region
    ADD CONSTRAINT regiopk PRIMARY KEY (idregion);


--
-- TOC entry 7701 (class 2606 OID 89476)
-- Dependencies: 638 638 638 8870
-- Name: relacionactuacionhistoricoprocesalpersona_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionactuacionhistoricoprocesalpersona
    ADD CONSTRAINT relacionactuacionhistoricoprocesalpersona_pk PRIMARY KEY (idhistoricoprocesaldecision, idpersona);


--
-- TOC entry 7703 (class 2606 OID 89478)
-- Dependencies: 640 640 640 8870
-- Name: relacionalbumfotograficofoto_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionalbumfotograficofoto
    ADD CONSTRAINT relacionalbumfotograficofoto_pk PRIMARY KEY (idfoto, idalbumfotografico);


--
-- TOC entry 7705 (class 2606 OID 89480)
-- Dependencies: 642 642 8870
-- Name: relacionaudienciacarpeta_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_pkey PRIMARY KEY (idrelacionaudienciacarpeta);


--
-- TOC entry 7707 (class 2606 OID 89482)
-- Dependencies: 645 645 645 8870
-- Name: relacionaudienciafiscal_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionaudienciafiscal
    ADD CONSTRAINT relacionaudienciafiscal_pkey PRIMARY KEY (fiscal, idaudiencia);


--
-- TOC entry 7709 (class 2606 OID 89484)
-- Dependencies: 647 647 647 8870
-- Name: relacionaudienciaradicado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionaudienciaradicado
    ADD CONSTRAINT relacionaudienciaradicado_pkey PRIMARY KEY (radicado, idaudiencia);


--
-- TOC entry 7713 (class 2606 OID 89486)
-- Dependencies: 651 651 651 8870
-- Name: relacionautorhecho_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT relacionautorhecho_pk PRIMARY KEY (idpersona, idhecho);


--
-- TOC entry 7715 (class 2606 OID 89488)
-- Dependencies: 653 653 653 8870
-- Name: relacionbienhecho_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionbienhecho
    ADD CONSTRAINT relacionbienhecho_pkey PRIMARY KEY (idbien, idhecho);


--
-- TOC entry 7717 (class 2606 OID 89490)
-- Dependencies: 655 655 8870
-- Name: relacioncarpetahechoevento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioncarpetahechoevento
    ADD CONSTRAINT relacioncarpetahechoevento_pk PRIMARY KEY (idevento);


--
-- TOC entry 7719 (class 2606 OID 89492)
-- Dependencies: 657 657 657 8870
-- Name: relacioncausadecisionterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioncausadecisionterminacionprocesopostulado
    ADD CONSTRAINT relacioncausadecisionterminacionprocesopostulado_pkey PRIMARY KEY (idcausaterminacion, iddecisionterminacion);


--
-- TOC entry 7721 (class 2606 OID 89494)
-- Dependencies: 659 659 659 8870
-- Name: relacioncausaterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacioncausaterminacionprocesopostulado
    ADD CONSTRAINT relacioncausaterminacionprocesopostulado_pkey PRIMARY KEY (idcausaterminacion, idsolicitudterminacion);


--
-- TOC entry 7725 (class 2606 OID 89496)
-- Dependencies: 663 663 663 8870
-- Name: relaciondespacho_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciondespacho
    ADD CONSTRAINT relaciondespacho_pk PRIMARY KEY (iddespachopadre, iddespachohijo);


--
-- TOC entry 7727 (class 2606 OID 89498)
-- Dependencies: 665 665 665 8870
-- Name: relaciondocumentoedictopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciondocumentoedictopostulado
    ADD CONSTRAINT relaciondocumentoedictopostulado_pkey PRIMARY KEY (radicado, iddocumentoedictoemplazatorio);


--
-- TOC entry 7729 (class 2606 OID 89500)
-- Dependencies: 667 667 667 8870
-- Name: relaciondocumentospostulacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciondocumentospostulacion
    ADD CONSTRAINT relaciondocumentospostulacion_pkey PRIMARY KEY (iddocumentospostulacion, radicado);


--
-- TOC entry 7731 (class 2606 OID 89502)
-- Dependencies: 669 669 669 8870
-- Name: relacionevento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionevento
    ADD CONSTRAINT relacionevento_pk PRIMARY KEY (idevento1, idevento2);


--
-- TOC entry 7711 (class 2606 OID 89504)
-- Dependencies: 649 649 649 8870
-- Name: relacioneventopersonapk1; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionautorevento
    ADD CONSTRAINT relacioneventopersonapk1 PRIMARY KEY (idevento, idpersona);


--
-- TOC entry 7737 (class 2606 OID 89506)
-- Dependencies: 675 675 675 8870
-- Name: relacionfiscaldespachoversion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionfiscaldespachoversion
    ADD CONSTRAINT relacionfiscaldespachoversion_pk PRIMARY KEY (idversion, fiscal);


--
-- TOC entry 7739 (class 2606 OID 89508)
-- Dependencies: 677 677 677 8870
-- Name: relacionfuentehistorialpga_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionfuentehistorialpga
    ADD CONSTRAINT relacionfuentehistorialpga_pk PRIMARY KEY (idfuenteinformacion, idhistorial);


--
-- TOC entry 7741 (class 2606 OID 89510)
-- Dependencies: 679 679 679 8870
-- Name: relacionfuentepersonapk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionfuentepersona
    ADD CONSTRAINT relacionfuentepersonapk PRIMARY KEY (idfuente, idevento);


--
-- TOC entry 7743 (class 2606 OID 89512)
-- Dependencies: 681 681 681 8870
-- Name: relacionfuncionperfil_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionfuncionperfil
    ADD CONSTRAINT relacionfuncionperfil_pkey PRIMARY KEY (idperfil, idfuncion);


--
-- TOC entry 7745 (class 2606 OID 89514)
-- Dependencies: 683 683 683 8870
-- Name: relaciongenesisgrupoarmadofuenteinformacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciongenesisgrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongenesisgrupoarmadofuenteinformacion_pkey PRIMARY KEY (idgenesisgrupoarmado, idfuenteinformacion);


--
-- TOC entry 7747 (class 2606 OID 89516)
-- Dependencies: 685 685 685 685 8870
-- Name: relaciongenesisgrupoarmadoversion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciongenesisgrupoarmadoversion
    ADD CONSTRAINT relaciongenesisgrupoarmadoversion_pkey PRIMARY KEY (idversion, radicado, idgenesisgrupoarmado);


--
-- TOC entry 7749 (class 2606 OID 89518)
-- Dependencies: 687 687 687 8870
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadofuenteinformacion_pkey PRIMARY KEY (idgeoreferenciaciongrupoarmado, idfuenteinformacion);


--
-- TOC entry 7751 (class 2606 OID 89520)
-- Dependencies: 689 689 689 689 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadoversion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadoversion_pkey PRIMARY KEY (idversion, radicado, idgeoreferenciaciongrupoarmado);


--
-- TOC entry 7755 (class 2606 OID 89522)
-- Dependencies: 693 693 693 8870
-- Name: relacionidentificaciongrupoarmadofuenteinformacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relacionidentificaciongrupoarmadofuenteinformacion_pkey PRIMARY KEY (ididentificaciongrupoarmado, idfuenteinformacion);


--
-- TOC entry 7757 (class 2606 OID 89524)
-- Dependencies: 695 695 695 695 8870
-- Name: relacionidentificaciongrupoarmadoversion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadoversion
    ADD CONSTRAINT relacionidentificaciongrupoarmadoversion_pkey PRIMARY KEY (idversion, radicado, ididentificaciongrupoarmado);


--
-- TOC entry 7759 (class 2606 OID 89526)
-- Dependencies: 697 697 697 8870
-- Name: relacionmagistradoaudiencia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionmagistradoaudiencia
    ADD CONSTRAINT relacionmagistradoaudiencia_pkey PRIMARY KEY (idaudiencia, idmagistrado);


--
-- TOC entry 7763 (class 2606 OID 89528)
-- Dependencies: 701 701 701 8870
-- Name: relacionperfilreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionperfilreporte
    ADD CONSTRAINT relacionperfilreporte_pk PRIMARY KEY (idperfil, idreporte);


--
-- TOC entry 7489 (class 2606 OID 89530)
-- Dependencies: 332 332 8870
-- Name: relacionpersonajuridicacolectividad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_pkey PRIMARY KEY (idrelacionpersonajuridicacolectividad);


--
-- TOC entry 7767 (class 2606 OID 89532)
-- Dependencies: 707 707 707 8870
-- Name: relacionpersonaparentesco_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpersonaparentesco
    ADD CONSTRAINT relacionpersonaparentesco_pkey PRIMARY KEY (idpersonaprincipal, idpersonasecundaria);


--
-- TOC entry 7773 (class 2606 OID 89536)
-- Dependencies: 713 713 713 8870
-- Name: relacionpostuladoversion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpostuladoversion
    ADD CONSTRAINT relacionpostuladoversion_pk PRIMARY KEY (idversion, radicado);


--
-- TOC entry 7775 (class 2606 OID 89538)
-- Dependencies: 715 715 715 8870
-- Name: relacionpublicacionexternapostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpublicacionexternapostulado
    ADD CONSTRAINT relacionpublicacionexternapostulado_pkey PRIMARY KEY (idpublicacionexterna, radicado);


--
-- TOC entry 7777 (class 2606 OID 89540)
-- Dependencies: 717 717 717 8870
-- Name: relacionpublicacioninternapostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionpublicacioninternapostulado
    ADD CONSTRAINT relacionpublicacioninternapostulado_pkey PRIMARY KEY (idpublicacioninterna, radicado);


--
-- TOC entry 7779 (class 2606 OID 89542)
-- Dependencies: 719 719 719 8870
-- Name: relacionregistrohechodocumento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionregistrohechodocumento
    ADD CONSTRAINT relacionregistrohechodocumento_pk PRIMARY KEY (idregistrohecho, iddocumento);


--
-- TOC entry 7781 (class 2606 OID 89544)
-- Dependencies: 721 721 721 8870
-- Name: relacionreporteprogramacionreporte_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionreporteprogramacionreporte
    ADD CONSTRAINT relacionreporteprogramacionreporte_pk PRIMARY KEY (idprogramacionreporte, idreporte);


--
-- TOC entry 7783 (class 2606 OID 89546)
-- Dependencies: 725 725 725 8870
-- Name: relacionversionevento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionversionevento
    ADD CONSTRAINT relacionversionevento_pk PRIMARY KEY (idevento, idversion);


--
-- TOC entry 7785 (class 2606 OID 89548)
-- Dependencies: 727 727 727 8870
-- Name: relacionversionhistorialpga_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionversionhistorialpga
    ADD CONSTRAINT relacionversionhistorialpga_pk PRIMARY KEY (idversion, idhistorial);


--
-- TOC entry 7789 (class 2606 OID 89550)
-- Dependencies: 729 729 729 8870
-- Name: relacionvicitmahechopk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT relacionvicitmahechopk PRIMARY KEY (idvictima, idhecho);


--
-- TOC entry 7791 (class 2606 OID 89552)
-- Dependencies: 731 731 8870
-- Name: religion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY religion
    ADD CONSTRAINT religion_pk PRIMARY KEY (idreligion);


--
-- TOC entry 7795 (class 2606 OID 89554)
-- Dependencies: 737 737 737 8870
-- Name: reposicionterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reposicionterminacionprocesopostulado
    ADD CONSTRAINT reposicionterminacionprocesopostulado_pkey PRIMARY KEY (iddecisionterminacion, idtipoparticipanteaudiencia);


--
-- TOC entry 7797 (class 2606 OID 89556)
-- Dependencies: 739 739 8870
-- Name: resolucionasignacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY resolucionasignacion
    ADD CONSTRAINT resolucionasignacion_pkey PRIMARY KEY (idresolucionasignacion);


--
-- TOC entry 7799 (class 2606 OID 89558)
-- Dependencies: 743 743 8870
-- Name: rol_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY rol
    ADD CONSTRAINT rol_pkey PRIMARY KEY (idrol);


--
-- TOC entry 7801 (class 2606 OID 89560)
-- Dependencies: 744 744 8870
-- Name: salaconocimiento_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY salaconocimiento
    ADD CONSTRAINT salaconocimiento_pkey PRIMARY KEY (idsalaconocimiento);


--
-- TOC entry 7803 (class 2606 OID 89562)
-- Dependencies: 747 747 8870
-- Name: salaversion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY salaversion
    ADD CONSTRAINT salaversion_pk PRIMARY KEY (idsalaversion);


--
-- TOC entry 7805 (class 2606 OID 89564)
-- Dependencies: 750 750 8870
-- Name: sede_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY sede
    ADD CONSTRAINT sede_pk PRIMARY KEY (idsede);


--
-- TOC entry 7807 (class 2606 OID 89566)
-- Dependencies: 752 752 8870
-- Name: senal_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY senal
    ADD CONSTRAINT senal_pkey PRIMARY KEY (idsenal);


--
-- TOC entry 7809 (class 2606 OID 89568)
-- Dependencies: 753 753 753 8870
-- Name: sentenciajyp_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY sentenciajyp
    ADD CONSTRAINT sentenciajyp_pkey PRIMARY KEY (radicado, idaudiencia);


--
-- TOC entry 7811 (class 2606 OID 89570)
-- Dependencies: 756 756 8870
-- Name: solicitudterminacionprocesopostulado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_pkey PRIMARY KEY (idsolicitudterminacion);


--
-- TOC entry 7813 (class 2606 OID 89572)
-- Dependencies: 759 759 8870
-- Name: subtipodelito_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY subtipodelito
    ADD CONSTRAINT subtipodelito_pkey PRIMARY KEY (idsubtipodelito);


--
-- TOC entry 7815 (class 2606 OID 89574)
-- Dependencies: 760 760 8870
-- Name: tendenciasexual_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tendenciasexual
    ADD CONSTRAINT tendenciasexual_pkey PRIMARY KEY (idtendenciasexual);


--
-- TOC entry 7817 (class 2606 OID 89576)
-- Dependencies: 763 763 8870
-- Name: terminacionetapaprocesal_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY terminacionetapaprocesal
    ADD CONSTRAINT terminacionetapaprocesal_pkey PRIMARY KEY (idterminacionetapaprocesal);


--
-- TOC entry 7819 (class 2606 OID 89578)
-- Dependencies: 766 766 8870
-- Name: tipoaccesosalud_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoaccesosalud
    ADD CONSTRAINT tipoaccesosalud_pkey PRIMARY KEY (idtipoaccesosalud);


--
-- TOC entry 7821 (class 2606 OID 89580)
-- Dependencies: 769 769 8870
-- Name: tipoactaasignacion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoactaasignacion
    ADD CONSTRAINT tipoactaasignacion_pkey PRIMARY KEY (idtipoactaasignacion);


--
-- TOC entry 7825 (class 2606 OID 89582)
-- Dependencies: 775 775 8870
-- Name: tipoadquisicion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoadquisicion
    ADD CONSTRAINT tipoadquisicion_pk PRIMARY KEY (idtipoadquisicion);


--
-- TOC entry 7827 (class 2606 OID 89584)
-- Dependencies: 777 777 8870
-- Name: tipoalbumfotografico_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoalbumfotografico
    ADD CONSTRAINT tipoalbumfotografico_pk PRIMARY KEY (idtipoalbumfotografico);


--
-- TOC entry 7829 (class 2606 OID 89586)
-- Dependencies: 780 780 8870
-- Name: tipoaplicaley_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoaplicaley
    ADD CONSTRAINT tipoaplicaley_pkey PRIMARY KEY (idtipoaplicaley);


--
-- TOC entry 7831 (class 2606 OID 89588)
-- Dependencies: 783 783 8870
-- Name: tipoapoderado_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoapoderado
    ADD CONSTRAINT tipoapoderado_pk PRIMARY KEY (idtipoapoderado);


--
-- TOC entry 7833 (class 2606 OID 89590)
-- Dependencies: 786 786 8870
-- Name: tipoaudiencia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoaudiencia
    ADD CONSTRAINT tipoaudiencia_pkey PRIMARY KEY (idtipoaudiencia);


--
-- TOC entry 7835 (class 2606 OID 89592)
-- Dependencies: 790 790 8870
-- Name: tipobien_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipobien
    ADD CONSTRAINT tipobien_pk PRIMARY KEY (idtipobien);


--
-- TOC entry 7837 (class 2606 OID 89594)
-- Dependencies: 792 792 8870
-- Name: tipocaratula_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipocaratula
    ADD CONSTRAINT tipocaratula_pkey PRIMARY KEY (idtipocaratula);


--
-- TOC entry 7839 (class 2606 OID 89596)
-- Dependencies: 795 795 8870
-- Name: tipoclasificacionpersonajuridica_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoclasificacionpersonajuridica
    ADD CONSTRAINT tipoclasificacionpersonajuridica_pkey PRIMARY KEY (idtipoclasificacionpersonajuridica);


--
-- TOC entry 7843 (class 2606 OID 89598)
-- Dependencies: 802 802 8870
-- Name: tipodesolicitud_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodesolicitud
    ADD CONSTRAINT tipodesolicitud_pkey PRIMARY KEY (idtipodesolicitud);


--
-- TOC entry 7845 (class 2606 OID 89600)
-- Dependencies: 803 803 8870
-- Name: tipodiscapacidad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodiscapacidad
    ADD CONSTRAINT tipodiscapacidad_pkey PRIMARY KEY (idtipodiscapacidad);


--
-- TOC entry 7847 (class 2606 OID 89602)
-- Dependencies: 806 806 8870
-- Name: tipodocumento_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumento
    ADD CONSTRAINT tipodocumento_pk PRIMARY KEY (idtipodocumento);


--
-- TOC entry 7851 (class 2606 OID 89604)
-- Dependencies: 812 812 8870
-- Name: tipodocumentocompulsacion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentocompulsacion
    ADD CONSTRAINT tipodocumentocompulsacion_pk PRIMARY KEY (idtipodocumentocompulsacion);


--
-- TOC entry 7853 (class 2606 OID 89606)
-- Dependencies: 816 816 8870
-- Name: tipodocumentoedictoemplazatorio_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentoedictoemplazatorio
    ADD CONSTRAINT tipodocumentoedictoemplazatorio_pkey PRIMARY KEY (idtipodocumentoedictoemplazatorio);


--
-- TOC entry 7855 (class 2606 OID 89608)
-- Dependencies: 820 820 8870
-- Name: tipodocumentoidentidad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentoidentidad
    ADD CONSTRAINT tipodocumentoidentidad_pkey PRIMARY KEY (idtipodocumentoidentidad);


--
-- TOC entry 7857 (class 2606 OID 89610)
-- Dependencies: 822 822 8870
-- Name: tipodocumentopersona_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentopersona
    ADD CONSTRAINT tipodocumentopersona_pk PRIMARY KEY (idtipodocumentopersona);


--
-- TOC entry 7861 (class 2606 OID 89612)
-- Dependencies: 828 828 8870
-- Name: tipodocumentotitularidad_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipodocumentotitularidadbien
    ADD CONSTRAINT tipodocumentotitularidad_pk PRIMARY KEY (idtipodocumentotitularidadbien);


--
-- TOC entry 7863 (class 2606 OID 89614)
-- Dependencies: 830 830 8870
-- Name: tipoedad_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoedad
    ADD CONSTRAINT tipoedad_pk PRIMARY KEY (idtipoedad);


--
-- TOC entry 7867 (class 2606 OID 89616)
-- Dependencies: 836 836 8870
-- Name: tipoestadopersona_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoestadopersona
    ADD CONSTRAINT tipoestadopersona_pkey PRIMARY KEY (idtipoestadopersona);


--
-- TOC entry 7869 (class 2606 OID 89618)
-- Dependencies: 838 838 8870
-- Name: tipofecha_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipofecha
    ADD CONSTRAINT tipofecha_pk PRIMARY KEY (idtipofecha);


--
-- TOC entry 7871 (class 2606 OID 89620)
-- Dependencies: 841 841 8870
-- Name: tipofenomenohistorico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipofenomenohistorico
    ADD CONSTRAINT tipofenomenohistorico_pkey PRIMARY KEY (idtipofenomenohistorico);


--
-- TOC entry 7873 (class 2606 OID 89622)
-- Dependencies: 845 845 8870
-- Name: tipohechoversion_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipohechoversion
    ADD CONSTRAINT tipohechoversion_pk PRIMARY KEY (idtipohechoversion);


--
-- TOC entry 7875 (class 2606 OID 89624)
-- Dependencies: 848 848 8870
-- Name: tipohistorialreclusion_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipohistorialreclusion
    ADD CONSTRAINT tipohistorialreclusion_pkey PRIMARY KEY (idtipohistorialreclusion);


--
-- TOC entry 7877 (class 2606 OID 89626)
-- Dependencies: 851 851 8870
-- Name: tipoidentificaciongrupoarmado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoidentificaciongrupoarmado
    ADD CONSTRAINT tipoidentificaciongrupoarmado_pkey PRIMARY KEY (idtipoidentificaciongrupoarmado);


--
-- TOC entry 7879 (class 2606 OID 89628)
-- Dependencies: 854 854 8870
-- Name: tipoinactivopostulado_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoinactivopostulado
    ADD CONSTRAINT tipoinactivopostulado_uniq UNIQUE (idtipoinactivopostulado);


--
-- TOC entry 7881 (class 2606 OID 89630)
-- Dependencies: 857 857 8870
-- Name: tipojefe_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipojefe
    ADD CONSTRAINT tipojefe_uniq UNIQUE (idtipojefe);


--
-- TOC entry 7885 (class 2606 OID 89632)
-- Dependencies: 862 862 8870
-- Name: tipomediopublicacion_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipomediopublicacion
    ADD CONSTRAINT tipomediopublicacion_uniq UNIQUE (idtipomediopublicacion);


--
-- TOC entry 7887 (class 2606 OID 89634)
-- Dependencies: 865 865 8870
-- Name: tipomoneda_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipomoneda
    ADD CONSTRAINT tipomoneda_uniq UNIQUE (idtipomoneda);


--
-- TOC entry 7889 (class 2606 OID 89636)
-- Dependencies: 868 868 8870
-- Name: tiponivelsisben_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiponivelsisben
    ADD CONSTRAINT tiponivelsisben_uniq UNIQUE (idtiponivelsisben);


--
-- TOC entry 7893 (class 2606 OID 89638)
-- Dependencies: 874 874 8870
-- Name: tipoparticipacion_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoparticipacion
    ADD CONSTRAINT tipoparticipacion_uniq UNIQUE (idtipoparticipacion);


--
-- TOC entry 7895 (class 2606 OID 89640)
-- Dependencies: 877 877 8870
-- Name: tipoparticipanteaudiencia_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoparticipanteaudiencia
    ADD CONSTRAINT tipoparticipanteaudiencia_uniq UNIQUE (idtipoparticipanteaudiencia);


--
-- TOC entry 7897 (class 2606 OID 89642)
-- Dependencies: 880 880 8870
-- Name: tipoperfilfotopersona_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoperfilfotopersona
    ADD CONSTRAINT tipoperfilfotopersona_uniq UNIQUE (idtipoperfilfotopersona);


--
-- TOC entry 7899 (class 2606 OID 89644)
-- Dependencies: 884 884 8870
-- Name: tipopersona_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipopersona
    ADD CONSTRAINT tipopersona_uniq UNIQUE (idtipopersona);


--
-- TOC entry 7903 (class 2606 OID 89646)
-- Dependencies: 888 888 8870
-- Name: tipopreclusionpostulado_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipopreclusionpostulado
    ADD CONSTRAINT tipopreclusionpostulado_uniq UNIQUE (idtipopreclusionpostulado);


--
-- TOC entry 7905 (class 2606 OID 89648)
-- Dependencies: 891 891 8870
-- Name: tipoprocesojyp_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoprocesojyp
    ADD CONSTRAINT tipoprocesojyp_uniq UNIQUE (idtipoprocesojyp);


--
-- TOC entry 7907 (class 2606 OID 89650)
-- Dependencies: 894 894 8870
-- Name: tiporangoedad_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiporangoedad
    ADD CONSTRAINT tiporangoedad_uniq UNIQUE (idtiporangoedad);


--
-- TOC entry 7911 (class 2606 OID 89652)
-- Dependencies: 901 901 8870
-- Name: tiporelacionparentesco_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiporelacionparentesco
    ADD CONSTRAINT tiporelacionparentesco_uniq UNIQUE (idtiporelacionparentesco);


--
-- TOC entry 7913 (class 2606 OID 89654)
-- Dependencies: 902 902 8870
-- Name: tiporelacionpersonajuridicacolectividad_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiporelacionpersonajuridicacolectividad
    ADD CONSTRAINT tiporelacionpersonajuridicacolectividad_uniq UNIQUE (idtiporelacionpersonajuridicacolectividad);


--
-- TOC entry 7915 (class 2606 OID 89656)
-- Dependencies: 905 905 8870
-- Name: tiposectortrabajo_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiposectortrabajo
    ADD CONSTRAINT tiposectortrabajo_uniq UNIQUE (idtiposectortrabajo);


--
-- TOC entry 7917 (class 2606 OID 89658)
-- Dependencies: 908 908 8870
-- Name: tiposubclasificacionpersonajuridica_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tiposubclasificacionpersonajuridica
    ADD CONSTRAINT tiposubclasificacionpersonajuridica_uniq UNIQUE (idtiposubclasificacionpersonajuridica);


--
-- TOC entry 7919 (class 2606 OID 89660)
-- Dependencies: 911 911 8870
-- Name: tipoterminacionprocesopostulado_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoterminacionprocesopostulado
    ADD CONSTRAINT tipoterminacionprocesopostulado_uniq UNIQUE (idtipoterminacion);


--
-- TOC entry 7921 (class 2606 OID 89662)
-- Dependencies: 914 914 8870
-- Name: tipotitular_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipotitular
    ADD CONSTRAINT tipotitular_uniq UNIQUE (idtipotitular);


--
-- TOC entry 7925 (class 2606 OID 89664)
-- Dependencies: 920 920 8870
-- Name: tipoubicacion_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoubicacion
    ADD CONSTRAINT tipoubicacion_uniq UNIQUE (idtipoubicacion);


--
-- TOC entry 7483 (class 2606 OID 89666)
-- Dependencies: 329 329 8870
-- Name: usuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuario_pkey PRIMARY KEY (login);


--
-- TOC entry 7929 (class 2606 OID 89668)
-- Dependencies: 940 940 8870
-- Name: version_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY version
    ADD CONSTRAINT version_pk PRIMARY KEY (idversion);


--
-- TOC entry 7584 (class 1259 OID 89669)
-- Dependencies: 475 8870
-- Name: fki_connotacion_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_connotacion_fk ON evento USING btree (idconnotacion);


--
-- TOC entry 7585 (class 1259 OID 89670)
-- Dependencies: 475 8870
-- Name: fki_origenevento_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_origenevento_fk ON evento USING btree (idorigenevento);


--
-- TOC entry 7498 (class 1259 OID 89671)
-- Dependencies: 355 8870
-- Name: fki_tipoapoderado; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_tipoapoderado ON apoderado USING btree (idtipoapoderado);


--
-- TOC entry 7786 (class 1259 OID 89672)
-- Dependencies: 729 8870
-- Name: fki_tipoedad_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_tipoedad_fk ON relacionvictimahecho USING btree (idtipoedad);


--
-- TOC entry 7586 (class 1259 OID 89673)
-- Dependencies: 475 8870
-- Name: fki_tipofecha_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_tipofecha_fk ON evento USING btree (idtipofecha);


--
-- TOC entry 7617 (class 1259 OID 89674)
-- Dependencies: 516 8870
-- Name: fki_tipofechah_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_tipofechah_fk ON hecho USING btree (idtipofecha);


--
-- TOC entry 7787 (class 1259 OID 89675)
-- Dependencies: 729 8870
-- Name: fki_tiporangoedad_fk; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_tiporangoedad_fk ON relacionvictimahecho USING btree (idtiporangoedad);


--
-- TOC entry 7531 (class 1259 OID 89676)
-- Dependencies: 402 8870
-- Name: id; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE UNIQUE INDEX id ON datosconsultaporusuario USING btree (id);


--
-- TOC entry 8557 (class 2620 OID 89677)
-- Dependencies: 333 1280 8870
-- Name: accesobloque_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER accesobloque_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON accesobloque FOR EACH ROW EXECUTE PROCEDURE accesobloque_audit_fun();


--
-- TOC entry 10865 (class 0 OID 0)
-- Dependencies: 8557
-- Name: TRIGGER accesobloque_trigger_fun ON accesobloque; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER accesobloque_trigger_fun ON accesobloque IS 'Tabla acceso bloque';


--
-- TOC entry 8558 (class 2620 OID 89678)
-- Dependencies: 335 1281 8870
-- Name: acta_asignacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER acta_asignacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON acta_asignacion FOR EACH ROW EXECUTE PROCEDURE acta_asignacion_audit_fun();


--
-- TOC entry 8559 (class 2620 OID 89679)
-- Dependencies: 338 1282 8870
-- Name: actareasignacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER actareasignacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON actareasignacion FOR EACH ROW EXECUTE PROCEDURE actareasignacion_audit_fun();


--
-- TOC entry 8560 (class 2620 OID 89680)
-- Dependencies: 340 1283 8870
-- Name: actividadfuenteinformacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER actividadfuenteinformacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON actividadfuenteinformacion FOR EACH ROW EXECUTE PROCEDURE actividadfuenteinformacion_audit_fun();


--
-- TOC entry 10866 (class 0 OID 0)
-- Dependencies: 8560
-- Name: TRIGGER actividadfuenteinformacion_audit_fun ON actividadfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER actividadfuenteinformacion_audit_fun ON actividadfuenteinformacion IS 'Actividades de la fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 8561 (class 2620 OID 89681)
-- Dependencies: 343 1300 8870
-- Name: actuacionhistoricoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER actuacionhistoricoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON actuacionhistoricoprocesal FOR EACH ROW EXECUTE PROCEDURE actuacionhistoricoprocesal_audit_fun();


--
-- TOC entry 8649 (class 2620 OID 89682)
-- Dependencies: 655 1301 8870
-- Name: actualizarorigencarpeta_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER actualizarorigencarpeta_fun AFTER INSERT OR UPDATE ON relacioncarpetahechoevento FOR EACH ROW EXECUTE PROCEDURE actualizarorigencarpeta_fun();


--
-- TOC entry 8562 (class 2620 OID 89683)
-- Dependencies: 346 1303 8870
-- Name: albumfotografico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER albumfotografico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON albumfotografico FOR EACH ROW EXECUTE PROCEDURE albumfotografico_audit_fun();


--
-- TOC entry 8563 (class 2620 OID 89684)
-- Dependencies: 349 1304 8870
-- Name: albumfotograficodownload_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER albumfotograficodownload_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON albumfotograficodownload FOR EACH ROW EXECUTE PROCEDURE albumfotograficodownload_audit_fun();


--
-- TOC entry 8564 (class 2620 OID 89685)
-- Dependencies: 353 1324 8870
-- Name: apelacionterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER apelacionterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON apelacionterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE apelacionterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8565 (class 2620 OID 89686)
-- Dependencies: 355 1325 8870
-- Name: apoderado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER apoderado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON apoderado FOR EACH ROW EXECUTE PROCEDURE apoderado_audit_fun();


--
-- TOC entry 10867 (class 0 OID 0)
-- Dependencies: 8565
-- Name: TRIGGER apoderado_trigger_fun ON apoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER apoderado_trigger_fun ON apoderado IS 'Registro de apoderados.';


--
-- TOC entry 8566 (class 2620 OID 89687)
-- Dependencies: 357 1328 8870
-- Name: asignaciongrupoarmado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER asignaciongrupoarmado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON asignaciongrupoarmado FOR EACH ROW EXECUTE PROCEDURE asignaciongrupoarmado_audit_fun();


--
-- TOC entry 8554 (class 2620 OID 89688)
-- Dependencies: 331 1329 8870
-- Name: asignacionpostulados_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER asignacionpostulados_fun AFTER INSERT OR UPDATE ON postulado FOR EACH ROW EXECUTE PROCEDURE asignacionpostulados_fun();


--
-- TOC entry 8568 (class 2620 OID 89689)
-- Dependencies: 364 1330 8870
-- Name: audiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER audiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON audiencia FOR EACH ROW EXECUTE PROCEDURE audiencia_audit_fun();


--
-- TOC entry 8569 (class 2620 OID 89690)
-- Dependencies: 370 1333 8870
-- Name: bien_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER bien_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON bien FOR EACH ROW EXECUTE PROCEDURE bien_audit_fun();


--
-- TOC entry 8570 (class 2620 OID 89691)
-- Dependencies: 372 1334 8870
-- Name: bien_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER bien_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON bienesentregadosdesmovilizacion FOR EACH ROW EXECUTE PROCEDURE bienesentregadosdesmovilizacion_audit_fun();


--
-- TOC entry 8571 (class 2620 OID 89692)
-- Dependencies: 378 1376 8870
-- Name: bien_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER bien_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON caracteristica FOR EACH ROW EXECUTE PROCEDURE caracteristica_audit_fun();


--
-- TOC entry 8572 (class 2620 OID 89693)
-- Dependencies: 382 1377 8870
-- Name: carpetahecho_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER carpetahecho_audit_fun AFTER INSERT OR DELETE OR UPDATE ON carpetahecho FOR EACH ROW EXECUTE PROCEDURE carpetahecho_audit_fun();


--
-- TOC entry 8573 (class 2620 OID 89694)
-- Dependencies: 385 1378 8870
-- Name: causaterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER causaterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON causaterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE causaterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8574 (class 2620 OID 89695)
-- Dependencies: 389 1381 8870
-- Name: clasedesmovilizacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER clasedesmovilizacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON clasedesmovilizacion FOR EACH ROW EXECUTE PROCEDURE clasedesmovilizacion_audit_fun();


--
-- TOC entry 8575 (class 2620 OID 89696)
-- Dependencies: 391 1382 8870
-- Name: compulsacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER compulsacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON compulsacion FOR EACH ROW EXECUTE PROCEDURE compulsacion_audit_fun();


--
-- TOC entry 8576 (class 2620 OID 89697)
-- Dependencies: 394 1398 8870
-- Name: connotacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER connotacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON connotacion FOR EACH ROW EXECUTE PROCEDURE connotacion_audit_fun();


--
-- TOC entry 10868 (class 0 OID 0)
-- Dependencies: 8576
-- Name: TRIGGER connotacion_audit_fun ON connotacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER connotacion_audit_fun ON connotacion IS 'Tipo de connotacion de un evento.';


--
-- TOC entry 8577 (class 2620 OID 89698)
-- Dependencies: 397 1399 8870
-- Name: controlregistrohechos_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER controlregistrohechos_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON controlregistrohechos FOR EACH ROW EXECUTE PROCEDURE controlregistrohechos_audit_fun();


--
-- TOC entry 10869 (class 0 OID 0)
-- Dependencies: 8577
-- Name: TRIGGER controlregistrohechos_trigger_fun ON controlregistrohechos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER controlregistrohechos_trigger_fun ON controlregistrohechos IS 'Control registro de hechos';


--
-- TOC entry 8578 (class 2620 OID 89699)
-- Dependencies: 400 1290 8870
-- Name: datosbasicos_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER datosbasicos_audit_fun AFTER INSERT OR DELETE OR UPDATE ON datosbasicos FOR EACH ROW EXECUTE PROCEDURE datosbasicos_audit_fun();


--
-- TOC entry 10870 (class 0 OID 0)
-- Dependencies: 8578
-- Name: TRIGGER datosbasicos_audit_fun ON datosbasicos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER datosbasicos_audit_fun ON datosbasicos IS 'Tabla para administrar las tablas basicas del aplicativo.';


--
-- TOC entry 8579 (class 2620 OID 89700)
-- Dependencies: 404 1424 8870
-- Name: decisionterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER decisionterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON decisionterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE decisionterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8580 (class 2620 OID 89701)
-- Dependencies: 408 1430 8870
-- Name: delito_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER delito_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON delito FOR EACH ROW EXECUTE PROCEDURE delito_audit_fun();


--
-- TOC entry 8581 (class 2620 OID 89702)
-- Dependencies: 410 1431 8870
-- Name: denunciaadicional_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER denunciaadicional_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON denunciaadicional FOR EACH ROW EXECUTE PROCEDURE denunciaadicional_audit_fun();


--
-- TOC entry 10871 (class 0 OID 0)
-- Dependencies: 8581
-- Name: TRIGGER denunciaadicional_trigger_fun ON denunciaadicional; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER denunciaadicional_trigger_fun ON denunciaadicional IS 'Tabla denuncia adicional';


--
-- TOC entry 8582 (class 2620 OID 89703)
-- Dependencies: 414 1432 8870
-- Name: desmovilizacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER desmovilizacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON desmovilizacion FOR EACH ROW EXECUTE PROCEDURE desmovilizacion_audit_fun();


--
-- TOC entry 10872 (class 0 OID 0)
-- Dependencies: 8582
-- Name: TRIGGER desmovilizacion_trigger_fun ON desmovilizacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER desmovilizacion_trigger_fun ON desmovilizacion IS 'Tabla desmovilizacion';


--
-- TOC entry 8583 (class 2620 OID 89704)
-- Dependencies: 417 1433 8870
-- Name: desmovilizado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER desmovilizado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON desmovilizado FOR EACH ROW EXECUTE PROCEDURE desmovilizado_audit_fun();


--
-- TOC entry 10873 (class 0 OID 0)
-- Dependencies: 8583
-- Name: TRIGGER desmovilizado_trigger_fun ON desmovilizado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER desmovilizado_trigger_fun ON desmovilizado IS 'Identificacion del desmovilizado';


--
-- TOC entry 8584 (class 2620 OID 89705)
-- Dependencies: 419 1434 8870
-- Name: despacho_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER despacho_audit_fun AFTER INSERT OR DELETE OR UPDATE ON despacho FOR EACH ROW EXECUTE PROCEDURE despacho_audit_fun();


--
-- TOC entry 8585 (class 2620 OID 89706)
-- Dependencies: 422 1444 8870
-- Name: documento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON documento FOR EACH ROW EXECUTE PROCEDURE documento_audit_fun();


--
-- TOC entry 10874 (class 0 OID 0)
-- Dependencies: 8585
-- Name: TRIGGER documento_trigger_fun ON documento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER documento_trigger_fun ON documento IS 'Documentos.';


--
-- TOC entry 8586 (class 2620 OID 89707)
-- Dependencies: 425 1445 8870
-- Name: documentocarpeta_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentocarpeta_audit_fun AFTER INSERT OR DELETE OR UPDATE ON documentocarpeta FOR EACH ROW EXECUTE PROCEDURE documentocarpeta_audit_fun();


--
-- TOC entry 8588 (class 2620 OID 89708)
-- Dependencies: 428 1446 8870
-- Name: documentocompulsacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentocompulsacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON documentocompulsacion FOR EACH ROW EXECUTE PROCEDURE documentocompulsacion_audit_fun();


--
-- TOC entry 8589 (class 2620 OID 89709)
-- Dependencies: 434 1447 8870
-- Name: documentoedictoemplazatorio_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentoedictoemplazatorio_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON documentoedictoemplazatorio FOR EACH ROW EXECUTE PROCEDURE documentoedictoemplazatorio_audit_fun();


--
-- TOC entry 8590 (class 2620 OID 89710)
-- Dependencies: 437 1448 8870
-- Name: documentopersona_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentopersona_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON documentopersona FOR EACH ROW EXECUTE PROCEDURE documentopersona_audit_fun();


--
-- TOC entry 10875 (class 0 OID 0)
-- Dependencies: 8590
-- Name: TRIGGER documentopersona_trigger_fun ON documentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER documentopersona_trigger_fun ON documentopersona IS 'Lista de documentos que tiene una persona.';


--
-- TOC entry 8591 (class 2620 OID 89711)
-- Dependencies: 440 1449 8870
-- Name: documentopostulacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentopostulacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON documentopostulacion FOR EACH ROW EXECUTE PROCEDURE documentopostulacion_audit_fun();


--
-- TOC entry 8592 (class 2620 OID 89712)
-- Dependencies: 443 1450 8870
-- Name: documentospostulacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER documentospostulacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON documentospostulacion FOR EACH ROW EXECUTE PROCEDURE documentospostulacion_audit_fun();


--
-- TOC entry 8593 (class 2620 OID 89713)
-- Dependencies: 452 1461 8870
-- Name: estadoetapaproceso_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER estadoetapaproceso_audit_fun AFTER INSERT OR DELETE OR UPDATE ON estadoetapaproceso FOR EACH ROW EXECUTE PROCEDURE estadoetapaproceso_audit_fun();


--
-- TOC entry 10876 (class 0 OID 0)
-- Dependencies: 8593
-- Name: TRIGGER estadoetapaproceso_audit_fun ON estadoetapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER estadoetapaproceso_audit_fun ON estadoetapaproceso IS 'Estados en los que se puede encontrar un proceso de Justicia y Paz.';


--
-- TOC entry 8594 (class 2620 OID 89714)
-- Dependencies: 455 1462 8870
-- Name: estadohistoricoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER estadohistoricoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON estadohistoricoprocesal FOR EACH ROW EXECUTE PROCEDURE estadohistoricoprocesal_audit_fun();


--
-- TOC entry 8595 (class 2620 OID 89715)
-- Dependencies: 458 1463 8870
-- Name: estadopostulado_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER estadopostulado_audit_fun AFTER INSERT OR DELETE OR UPDATE ON estadopostulado FOR EACH ROW EXECUTE PROCEDURE estadopostulado_audit_fun();


--
-- TOC entry 8596 (class 2620 OID 89716)
-- Dependencies: 461 1464 8870
-- Name: estadoprogramacionreporte_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER estadoprogramacionreporte_audit_fun AFTER INSERT OR DELETE OR UPDATE ON estadoprogramacionreporte FOR EACH ROW EXECUTE PROCEDURE estadoprogramacionreporte_audit_fun();


--
-- TOC entry 8597 (class 2620 OID 89717)
-- Dependencies: 466 1465 8870
-- Name: etapaflujoinformacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER etapaflujoinformacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON etapaflujoinformacion FOR EACH ROW EXECUTE PROCEDURE etapaflujoinformacion_audit_fun();


--
-- TOC entry 10877 (class 0 OID 0)
-- Dependencies: 8597
-- Name: TRIGGER etapaflujoinformacion_audit_fun ON etapaflujoinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER etapaflujoinformacion_audit_fun ON etapaflujoinformacion IS 'Etapas del flujo de informacion de una fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 8598 (class 2620 OID 89718)
-- Dependencies: 469 1466 8870
-- Name: etapahistoricoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER etapahistoricoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON etapahistoricoprocesal FOR EACH ROW EXECUTE PROCEDURE etapahistoricoprocesal_audit_fun();


--
-- TOC entry 8599 (class 2620 OID 89719)
-- Dependencies: 472 1467 8870
-- Name: etapaproceso_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER etapaproceso_audit_fun AFTER INSERT OR DELETE OR UPDATE ON etapaproceso FOR EACH ROW EXECUTE PROCEDURE etapaproceso_audit_fun();


--
-- TOC entry 10878 (class 0 OID 0)
-- Dependencies: 8599
-- Name: TRIGGER etapaproceso_audit_fun ON etapaproceso; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER etapaproceso_audit_fun ON etapaproceso IS 'Etapas del proceso de Justicia y Paz';


--
-- TOC entry 8600 (class 2620 OID 89720)
-- Dependencies: 475 1468 8870
-- Name: evento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER evento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON evento FOR EACH ROW EXECUTE PROCEDURE evento_audit_fun();


--
-- TOC entry 10879 (class 0 OID 0)
-- Dependencies: 8600
-- Name: TRIGGER evento_trigger_fun ON evento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER evento_trigger_fun ON evento IS 'Tabla caracteristicas evento';


--
-- TOC entry 8601 (class 2620 OID 89721)
-- Dependencies: 478 1470 8870
-- Name: factoringresoga_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER factoringresoga_audit_fun AFTER INSERT OR DELETE OR UPDATE ON factoringresoga FOR EACH ROW EXECUTE PROCEDURE factoringresoga_audit_fun();


--
-- TOC entry 8602 (class 2620 OID 89722)
-- Dependencies: 485 1477 8870
-- Name: fotos_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER fotos_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON fotos FOR EACH ROW EXECUTE PROCEDURE fotos_audit_fun();


--
-- TOC entry 10880 (class 0 OID 0)
-- Dependencies: 8602
-- Name: TRIGGER fotos_trigger_fun ON fotos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER fotos_trigger_fun ON fotos IS 'Tabla de fotos';


--
-- TOC entry 8603 (class 2620 OID 89723)
-- Dependencies: 490 1478 8870
-- Name: fuenteinformacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER fuenteinformacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON fuenteinformacion FOR EACH ROW EXECUTE PROCEDURE fuenteinformacion_audit_fun();


--
-- TOC entry 10881 (class 0 OID 0)
-- Dependencies: 8603
-- Name: TRIGGER fuenteinformacion_trigger_fun ON fuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER fuenteinformacion_trigger_fun ON fuenteinformacion IS 'Fuente de informacion';


--
-- TOC entry 8604 (class 2620 OID 89724)
-- Dependencies: 492 1479 8870
-- Name: fuenteinformaciondatos_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER fuenteinformaciondatos_audit_fun AFTER INSERT OR DELETE OR UPDATE ON fuenteinformaciondatos FOR EACH ROW EXECUTE PROCEDURE fuenteinformaciondatos_audit_fun();


--
-- TOC entry 10882 (class 0 OID 0)
-- Dependencies: 8604
-- Name: TRIGGER fuenteinformaciondatos_audit_fun ON fuenteinformaciondatos; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER fuenteinformaciondatos_audit_fun ON fuenteinformaciondatos IS 'Fuente de informacion el proceso de Justicia y Paz';


--
-- TOC entry 8605 (class 2620 OID 89725)
-- Dependencies: 497 1480 8870
-- Name: funcion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER funcion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON funcion FOR EACH ROW EXECUTE PROCEDURE funcion_audit_fun();


--
-- TOC entry 10883 (class 0 OID 0)
-- Dependencies: 8605
-- Name: TRIGGER funcion_trigger_fun ON funcion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER funcion_trigger_fun ON funcion IS 'funcion';


--
-- TOC entry 8567 (class 2620 OID 89726)
-- Dependencies: 357 1482 8870
-- Name: funcionasignaciongrupoarmadohistorico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER funcionasignaciongrupoarmadohistorico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON asignaciongrupoarmado FOR EACH ROW EXECUTE PROCEDURE funcionasignaciongrupoarmadohistorico_fun();


--
-- TOC entry 8606 (class 2620 OID 89727)
-- Dependencies: 500 1609 8870
-- Name: genesisgrupoarmado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER genesisgrupoarmado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON genesisgrupoarmado FOR EACH ROW EXECUTE PROCEDURE genesisgrupoarmado_audit_fun();


--
-- TOC entry 8607 (class 2620 OID 89728)
-- Dependencies: 504 1612 8870
-- Name: georeferenciacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER georeferenciacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON georeferenciacion FOR EACH ROW EXECUTE PROCEDURE georeferenciacion_audit_fun();


--
-- TOC entry 10884 (class 0 OID 0)
-- Dependencies: 8607
-- Name: TRIGGER georeferenciacion_trigger_fun ON georeferenciacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER georeferenciacion_trigger_fun ON georeferenciacion IS 'Tabla de georeferenciacion';


--
-- TOC entry 8608 (class 2620 OID 89729)
-- Dependencies: 506 1613 8870
-- Name: georeferenciaciongrupoarmado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER georeferenciaciongrupoarmado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON georeferenciaciongrupoarmado FOR EACH ROW EXECUTE PROCEDURE georeferenciaciongrupoarmado_audit_fun();


--
-- TOC entry 8609 (class 2620 OID 89730)
-- Dependencies: 512 1641 8870
-- Name: grupos_etnicos_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER grupos_etnicos_audit_fun AFTER INSERT OR DELETE OR UPDATE ON grupos_etnicos_audit FOR EACH ROW EXECUTE PROCEDURE grupos_etnicos_audit_fun();


--
-- TOC entry 8610 (class 2620 OID 89731)
-- Dependencies: 516 1665 8870
-- Name: hecho_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER hecho_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON hecho FOR EACH ROW EXECUTE PROCEDURE hecho_audit_fun();


--
-- TOC entry 10885 (class 0 OID 0)
-- Dependencies: 8610
-- Name: TRIGGER hecho_trigger_fun ON hecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER hecho_trigger_fun ON hecho IS 'Tabla circunstancias del hecho';


--
-- TOC entry 8611 (class 2620 OID 89732)
-- Dependencies: 520 1667 8870
-- Name: historialpersonaga_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historialpersonaga_audit_fun AFTER INSERT OR DELETE OR UPDATE ON historialpersonaga FOR EACH ROW EXECUTE PROCEDURE historialpersonaga_audit_fun();


--
-- TOC entry 8612 (class 2620 OID 89733)
-- Dependencies: 522 1668 8870
-- Name: historialreclusion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historialreclusion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON historialreclusion FOR EACH ROW EXECUTE PROCEDURE historialreclusion_audit_fun();


--
-- TOC entry 8613 (class 2620 OID 89734)
-- Dependencies: 526 1669 8870
-- Name: historialubicacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historialubicacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON historialubicacion FOR EACH ROW EXECUTE PROCEDURE historialubicacion_audit_fun();


--
-- TOC entry 10886 (class 0 OID 0)
-- Dependencies: 8613
-- Name: TRIGGER historialubicacion_trigger_fun ON historialubicacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER historialubicacion_trigger_fun ON historialubicacion IS 'historialubicacion';


--
-- TOC entry 8587 (class 2620 OID 89735)
-- Dependencies: 425 1670 8870
-- Name: historicodocumentocarpeta_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historicodocumentocarpeta_fun AFTER INSERT OR UPDATE ON documentocarpeta FOR EACH ROW EXECUTE PROCEDURE historicodocumentocarpeta_fun();


--
-- TOC entry 8614 (class 2620 OID 89736)
-- Dependencies: 530 1671 8870
-- Name: historicoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historicoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON historicoprocesal FOR EACH ROW EXECUTE PROCEDURE historicoprocesal_audit_fun();


--
-- TOC entry 8650 (class 2620 OID 89737)
-- Dependencies: 655 1672 8870
-- Name: historicorelacioncarpetahechoevento_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER historicorelacioncarpetahechoevento_fun AFTER INSERT OR UPDATE ON relacioncarpetahechoevento FOR EACH ROW EXECUTE PROCEDURE historicorelacioncarpetahechoevento_fun();


--
-- TOC entry 8615 (class 2620 OID 89738)
-- Dependencies: 535 1679 8870
-- Name: identificacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER identificacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON identificacion_audit FOR EACH ROW EXECUTE PROCEDURE identificacion_audit_fun();


--
-- TOC entry 8616 (class 2620 OID 89739)
-- Dependencies: 537 1680 8870
-- Name: identificaciongrupoarmado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER identificaciongrupoarmado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON identificaciongrupoarmado FOR EACH ROW EXECUTE PROCEDURE identificaciongrupoarmado_audit_fun();


--
-- TOC entry 8617 (class 2620 OID 89740)
-- Dependencies: 540 1866 8870
-- Name: jornadaaudiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER jornadaaudiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON jornadaaudiencia FOR EACH ROW EXECUTE PROCEDURE jornadaaudiencia_audit_fun();


--
-- TOC entry 8550 (class 2620 OID 89741)
-- Dependencies: 326 1908 8870
-- Name: magistrado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER magistrado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON magistrado FOR EACH ROW EXECUTE PROCEDURE magistrado_audit_fun();


--
-- TOC entry 8618 (class 2620 OID 89742)
-- Dependencies: 548 1918 8870
-- Name: mediopublicacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER mediopublicacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON mediopublicacion FOR EACH ROW EXECUTE PROCEDURE mediopublicacion_audit_fun();


--
-- TOC entry 8619 (class 2620 OID 89743)
-- Dependencies: 552 1920 8870
-- Name: menu_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER menu_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON menu FOR EACH ROW EXECUTE PROCEDURE menu_audit_fun();


--
-- TOC entry 10887 (class 0 OID 0)
-- Dependencies: 8619
-- Name: TRIGGER menu_trigger_fun ON menu; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER menu_trigger_fun ON menu IS 'Tabla menu';


--
-- TOC entry 8620 (class 2620 OID 89744)
-- Dependencies: 554 1923 8870
-- Name: modusoperandi_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER modusoperandi_audit_fun AFTER INSERT OR DELETE OR UPDATE ON modusoperandi FOR EACH ROW EXECUTE PROCEDURE modusoperandi_audit_fun();


--
-- TOC entry 10888 (class 0 OID 0)
-- Dependencies: 8620
-- Name: TRIGGER modusoperandi_audit_fun ON modusoperandi; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER modusoperandi_audit_fun ON modusoperandi IS 'Tipos de modus operandi.';


--
-- TOC entry 8621 (class 2620 OID 89745)
-- Dependencies: 557 1924 8870
-- Name: motivoterminacionetapapostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER motivoterminacionetapapostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON motivoterminacionetapapostulado FOR EACH ROW EXECUTE PROCEDURE motivoterminacionetapapostulado_audit_fun();


--
-- TOC entry 8622 (class 2620 OID 89746)
-- Dependencies: 560 1925 8870
-- Name: movil_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER movil_audit_fun AFTER INSERT OR DELETE OR UPDATE ON movil FOR EACH ROW EXECUTE PROCEDURE movil_audit_fun();


--
-- TOC entry 10889 (class 0 OID 0)
-- Dependencies: 8622
-- Name: TRIGGER movil_audit_fun ON movil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER movil_audit_fun ON movil IS 'Tipo de movil de un hecho.';


--
-- TOC entry 8623 (class 2620 OID 89747)
-- Dependencies: 565 1927 8870
-- Name: nivel_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER nivel_audit_fun AFTER INSERT OR DELETE OR UPDATE ON nivel FOR EACH ROW EXECUTE PROCEDURE nivel_audit_fun();


--
-- TOC entry 10890 (class 0 OID 0)
-- Dependencies: 8623
-- Name: TRIGGER nivel_audit_fun ON nivel; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER nivel_audit_fun ON nivel IS 'Tabla que representa los niveles (Alto Medio Bajo)';


--
-- TOC entry 8624 (class 2620 OID 89748)
-- Dependencies: 570 1930 8870
-- Name: notificacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER notificacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON notificacion FOR EACH ROW EXECUTE PROCEDURE notificacion_audit_fun();


--
-- TOC entry 10891 (class 0 OID 0)
-- Dependencies: 8624
-- Name: TRIGGER notificacion_trigger_fun ON notificacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER notificacion_trigger_fun ON notificacion IS 'Notificaciones';


--
-- TOC entry 8625 (class 2620 OID 89749)
-- Dependencies: 573 1931 8870
-- Name: notificacioncorreo_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER notificacioncorreo_audit_fun AFTER INSERT OR DELETE OR UPDATE ON notificacioncorreo FOR EACH ROW EXECUTE PROCEDURE notificacioncorreo_audit_fun();


--
-- TOC entry 8626 (class 2620 OID 89750)
-- Dependencies: 578 1934 8870
-- Name: origenevento_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER origenevento_audit_fun AFTER INSERT OR DELETE OR UPDATE ON origenevento FOR EACH ROW EXECUTE PROCEDURE origenevento_audit_fun();


--
-- TOC entry 10892 (class 0 OID 0)
-- Dependencies: 8626
-- Name: TRIGGER origenevento_audit_fun ON origenevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER origenevento_audit_fun ON origenevento IS 'Tipos de Origenes de los Eventos';


--
-- TOC entry 8627 (class 2620 OID 89751)
-- Dependencies: 581 1935 8870
-- Name: origenfuenteinformacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER origenfuenteinformacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON origenfuenteinformacion FOR EACH ROW EXECUTE PROCEDURE origenfuenteinformacion_audit_fun();


--
-- TOC entry 10893 (class 0 OID 0)
-- Dependencies: 8627
-- Name: TRIGGER origenfuenteinformacion_audit_fun ON origenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER origenfuenteinformacion_audit_fun ON origenfuenteinformacion IS 'Origen de una fuente de informacion del proceso de Justicia y Paz';


--
-- TOC entry 8628 (class 2620 OID 89752)
-- Dependencies: 584 1936 8870
-- Name: origenhechoversion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER origenhechoversion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON origenhechoversion FOR EACH ROW EXECUTE PROCEDURE origenhechoversion_audit_fun();


--
-- TOC entry 10894 (class 0 OID 0)
-- Dependencies: 8628
-- Name: TRIGGER origenhechoversion_audit_fun ON origenhechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER origenhechoversion_audit_fun ON origenhechoversion IS 'Origenes del hecho dentro de la version';


--
-- TOC entry 8629 (class 2620 OID 89753)
-- Dependencies: 589 1938 8870
-- Name: partidos_politicos_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER partidos_politicos_audit_fun AFTER INSERT OR DELETE OR UPDATE ON partidos_politicos FOR EACH ROW EXECUTE PROCEDURE partidos_politicos_audit_fun();


--
-- TOC entry 8551 (class 2620 OID 89754)
-- Dependencies: 328 1939 8870
-- Name: persona_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER persona_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON persona FOR EACH ROW EXECUTE PROCEDURE persona_audit_fun();


--
-- TOC entry 10895 (class 0 OID 0)
-- Dependencies: 8551
-- Name: TRIGGER persona_trigger_fun ON persona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER persona_trigger_fun ON persona IS 'Datos de la persona';


--
-- TOC entry 8630 (class 2620 OID 89755)
-- Dependencies: 595 1940 8870
-- Name: personacambiodeidentidad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER personacambiodeidentidad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON personacambiodeidentidad FOR EACH ROW EXECUTE PROCEDURE personacambiodeidentidad_audit_fun();


--
-- TOC entry 8631 (class 2620 OID 89756)
-- Dependencies: 598 1941 8870
-- Name: personaestadohistorico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER personaestadohistorico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON personaestadohistorico FOR EACH ROW EXECUTE PROCEDURE personaestadohistorico_audit_fun();


--
-- TOC entry 8632 (class 2620 OID 89757)
-- Dependencies: 601 1943 8870
-- Name: personaestadosocioeconomico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER personaestadosocioeconomico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON personaestadosocioeconomico FOR EACH ROW EXECUTE PROCEDURE personaestadosocioeconomico_audit_fun();


--
-- TOC entry 8553 (class 2620 OID 89758)
-- Dependencies: 330 1944 8870
-- Name: personajuridicacolectividad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER personajuridicacolectividad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON personajuridicacolectividad FOR EACH ROW EXECUTE PROCEDURE personajuridicacolectividad_audit_fun();


--
-- TOC entry 8633 (class 2620 OID 89759)
-- Dependencies: 606 1945 8870
-- Name: personajuridicacolectividadcorreo_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER personajuridicacolectividadcorreo_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON personajuridicacolectividadcorreo FOR EACH ROW EXECUTE PROCEDURE personajuridicacolectividadcorreo_audit_fun();


--
-- TOC entry 8555 (class 2620 OID 89760)
-- Dependencies: 331 1971 8870
-- Name: postulado_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER postulado_audit_fun AFTER INSERT OR DELETE OR UPDATE ON postulado FOR EACH ROW EXECUTE PROCEDURE postulado_audit_fun();


--
-- TOC entry 10896 (class 0 OID 0)
-- Dependencies: 8555
-- Name: TRIGGER postulado_audit_fun ON postulado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER postulado_audit_fun ON postulado IS 'Persona postulada a la ley 975 de Justicia y paz';


--
-- TOC entry 8634 (class 2620 OID 89761)
-- Dependencies: 611 1972 8870
-- Name: postuladoasignacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER postuladoasignacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON postuladoasignacion FOR EACH ROW EXECUTE PROCEDURE postuladoasignacion_audit_fun();


--
-- TOC entry 8635 (class 2620 OID 89762)
-- Dependencies: 614 1973 8870
-- Name: postuladoeventoaudiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER postuladoeventoaudiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON postuladoeventoaudiencia FOR EACH ROW EXECUTE PROCEDURE postuladoeventoaudiencia_audit_fun();


--
-- TOC entry 8636 (class 2620 OID 89763)
-- Dependencies: 620 1976 8870
-- Name: programacionreporte_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER programacionreporte_audit_fun AFTER INSERT OR DELETE OR UPDATE ON programacionreporte FOR EACH ROW EXECUTE PROCEDURE programacionreporte_audit_fun();


--
-- TOC entry 8637 (class 2620 OID 89764)
-- Dependencies: 623 1977 8870
-- Name: publicacionexterna_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER publicacionexterna_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON publicacionexterna FOR EACH ROW EXECUTE PROCEDURE publicacionexterna_audit_fun();


--
-- TOC entry 8638 (class 2620 OID 89765)
-- Dependencies: 626 1978 8870
-- Name: publicacioninterna_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER publicacioninterna_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON publicacioninterna FOR EACH ROW EXECUTE PROCEDURE publicacioninterna_audit_fun();


--
-- TOC entry 8639 (class 2620 OID 89766)
-- Dependencies: 631 1983 8870
-- Name: raza_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER raza_audit_fun AFTER INSERT OR DELETE OR UPDATE ON raza FOR EACH ROW EXECUTE PROCEDURE raza_audit_fun();


--
-- TOC entry 8640 (class 2620 OID 89767)
-- Dependencies: 635 1987 8870
-- Name: registrohecho_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER registrohecho_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON registrohecho FOR EACH ROW EXECUTE PROCEDURE registrohecho_audit_fun();


--
-- TOC entry 10897 (class 0 OID 0)
-- Dependencies: 8640
-- Name: TRIGGER registrohecho_trigger_fun ON registrohecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER registrohecho_trigger_fun ON registrohecho IS 'Registro de un hecho';


--
-- TOC entry 8641 (class 2620 OID 89768)
-- Dependencies: 638 1988 8870
-- Name: relacionactuacionhistoricoprocesalpersona_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionactuacionhistoricoprocesalpersona_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionactuacionhistoricoprocesalpersona FOR EACH ROW EXECUTE PROCEDURE relacionactuacionhistoricoprocesalpersona_audit_fun();


--
-- TOC entry 8642 (class 2620 OID 89769)
-- Dependencies: 640 1989 8870
-- Name: relacionalbumfotograficofoto_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionalbumfotograficofoto_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionalbumfotograficofoto FOR EACH ROW EXECUTE PROCEDURE relacionalbumfotograficofoto_audit_fun();


--
-- TOC entry 8643 (class 2620 OID 89770)
-- Dependencies: 642 1990 8870
-- Name: relacionaudienciacarpeta_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionaudienciacarpeta_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionaudienciacarpeta FOR EACH ROW EXECUTE PROCEDURE relacionaudienciacarpeta_audit_fun();


--
-- TOC entry 8644 (class 2620 OID 89771)
-- Dependencies: 645 1991 8870
-- Name: relacionaudienciafiscal_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionaudienciafiscal_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionaudienciafiscal FOR EACH ROW EXECUTE PROCEDURE relacionaudienciafiscal_audit_fun();


--
-- TOC entry 8645 (class 2620 OID 89772)
-- Dependencies: 647 1992 8870
-- Name: relacionaudienciaradicado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionaudienciaradicado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionaudienciaradicado FOR EACH ROW EXECUTE PROCEDURE relacionaudienciaradicado_audit_fun();


--
-- TOC entry 8646 (class 2620 OID 89773)
-- Dependencies: 649 1993 8870
-- Name: relacionautorevento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionautorevento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionautorevento FOR EACH ROW EXECUTE PROCEDURE relacionautorevento_audit_fun();


--
-- TOC entry 10898 (class 0 OID 0)
-- Dependencies: 8646
-- Name: TRIGGER relacionautorevento_trigger_fun ON relacionautorevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionautorevento_trigger_fun ON relacionautorevento IS 'Relacion del autor en un evento';


--
-- TOC entry 8647 (class 2620 OID 89774)
-- Dependencies: 651 1999 8870
-- Name: relacionautorhecho_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionautorhecho_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionautorhecho FOR EACH ROW EXECUTE PROCEDURE relacionautorhecho_audit_fun();


--
-- TOC entry 10899 (class 0 OID 0)
-- Dependencies: 8647
-- Name: TRIGGER relacionautorhecho_audit_fun ON relacionautorhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionautorhecho_audit_fun ON relacionautorhecho IS 'Relacion del autor de un hecho con el hecho';


--
-- TOC entry 8648 (class 2620 OID 89775)
-- Dependencies: 653 2000 8870
-- Name: relacionbienhecho_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionbienhecho_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionbienhecho FOR EACH ROW EXECUTE PROCEDURE relacionbienhecho_audit_fun();


--
-- TOC entry 10900 (class 0 OID 0)
-- Dependencies: 8648
-- Name: TRIGGER relacionbienhecho_trigger_fun ON relacionbienhecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionbienhecho_trigger_fun ON relacionbienhecho IS 'Relacion de un bien con un hecho';


--
-- TOC entry 8651 (class 2620 OID 89776)
-- Dependencies: 655 2001 8870
-- Name: relacioncarpetahechoevento_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioncarpetahechoevento_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacioncarpetahechoevento FOR EACH ROW EXECUTE PROCEDURE relacioncarpetahechoevento_audit_fun();


--
-- TOC entry 8652 (class 2620 OID 89777)
-- Dependencies: 657 2002 8870
-- Name: relacioncausadecisionterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioncausadecisionterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacioncausadecisionterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE relacioncausadecisionterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8653 (class 2620 OID 89778)
-- Dependencies: 659 2003 8870
-- Name: relacioncausaterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioncausaterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacioncausaterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE relacioncausaterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8654 (class 2620 OID 89779)
-- Dependencies: 661 2004 8870
-- Name: relacioncompulsacionhistoricoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioncompulsacionhistoricoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacioncompulsacionhistoricoprocesal FOR EACH ROW EXECUTE PROCEDURE relacioncompulsacionhistoricoprocesal_audit_fun();


--
-- TOC entry 8655 (class 2620 OID 89780)
-- Dependencies: 663 2005 8870
-- Name: relaciondespacho_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciondespacho_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relaciondespacho FOR EACH ROW EXECUTE PROCEDURE relaciondespacho_audit_fun();


--
-- TOC entry 8656 (class 2620 OID 89781)
-- Dependencies: 665 2006 8870
-- Name: relaciondocumentoedictopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciondocumentoedictopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relaciondocumentoedictopostulado FOR EACH ROW EXECUTE PROCEDURE relaciondocumentoedictopostulado_audit_fun();


--
-- TOC entry 8657 (class 2620 OID 89782)
-- Dependencies: 667 2007 8870
-- Name: relaciondocumentospostulacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciondocumentospostulacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relaciondocumentospostulacion FOR EACH ROW EXECUTE PROCEDURE relaciondocumentospostulacion_audit_fun();


--
-- TOC entry 8658 (class 2620 OID 89783)
-- Dependencies: 669 2008 8870
-- Name: relacionevento_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionevento_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionevento FOR EACH ROW EXECUTE PROCEDURE relacionevento_audit_fun();


--
-- TOC entry 8659 (class 2620 OID 89784)
-- Dependencies: 671 2009 8870
-- Name: relacioneventofuenteinfo_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioneventofuenteinfo_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacioneventofuenteinfo FOR EACH ROW EXECUTE PROCEDURE relacioneventofuenteinfo_audit_fun();


--
-- TOC entry 8660 (class 2620 OID 89785)
-- Dependencies: 673 2010 8870
-- Name: relacioneventomodusoperandi_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacioneventomodusoperandi_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacioneventomodusoperandi FOR EACH ROW EXECUTE PROCEDURE relacioneventomodusoperandi_audit_fun();


--
-- TOC entry 8661 (class 2620 OID 89786)
-- Dependencies: 675 2011 8870
-- Name: relacionfiscaldespachoversion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionfiscaldespachoversion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionfiscaldespachoversion FOR EACH ROW EXECUTE PROCEDURE relacionfiscaldespachoversion_audit_fun();


--
-- TOC entry 8662 (class 2620 OID 89787)
-- Dependencies: 677 2012 8870
-- Name: relacionfuentehistorialpga_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionfuentehistorialpga_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionfuentehistorialpga FOR EACH ROW EXECUTE PROCEDURE relacionfuentehistorialpga_audit_fun();


--
-- TOC entry 8663 (class 2620 OID 89788)
-- Dependencies: 679 2013 8870
-- Name: relacionfuentepersona_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionfuentepersona_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionfuentepersona FOR EACH ROW EXECUTE PROCEDURE relacionfuentepersona_audit_fun();


--
-- TOC entry 10901 (class 0 OID 0)
-- Dependencies: 8663
-- Name: TRIGGER relacionfuentepersona_trigger_fun ON relacionfuentepersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionfuentepersona_trigger_fun ON relacionfuentepersona IS 'Relacion fuente persona';


--
-- TOC entry 8664 (class 2620 OID 89789)
-- Dependencies: 681 2014 8870
-- Name: relacionfuncionperfil_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionfuncionperfil_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionfuncionperfil FOR EACH ROW EXECUTE PROCEDURE relacionfuncionperfil_audit_fun();


--
-- TOC entry 10902 (class 0 OID 0)
-- Dependencies: 8664
-- Name: TRIGGER relacionfuncionperfil_trigger_fun ON relacionfuncionperfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionfuncionperfil_trigger_fun ON relacionfuncionperfil IS 'Relacion funcion perfil';


--
-- TOC entry 8665 (class 2620 OID 89790)
-- Dependencies: 683 2015 8870
-- Name: relaciongenesisgrupoarmadofuenteinformacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciongenesisgrupoarmadofuenteinformacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relaciongenesisgrupoarmadofuenteinformacion FOR EACH ROW EXECUTE PROCEDURE relaciongenesisgrupoarmadofuenteinformacion_audit_fun();


--
-- TOC entry 8666 (class 2620 OID 89791)
-- Dependencies: 685 2016 8870
-- Name: relaciongenesisgrupoarmadoversion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciongenesisgrupoarmadoversion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relaciongenesisgrupoarmadoversion FOR EACH ROW EXECUTE PROCEDURE relaciongenesisgrupoarmadoversion_audit_fun();


--
-- TOC entry 8667 (class 2620 OID 89792)
-- Dependencies: 687 2017 8870
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_trigger_f; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciongeoreferenciaciongrupoarmadofuenteinformacion_trigger_f AFTER INSERT OR DELETE OR UPDATE ON relaciongeoreferenciaciongrupoarmadofuenteinformacion FOR EACH ROW EXECUTE PROCEDURE relaciongeoreferenciaciongrupoarmadofuenteinformacion_audit_fun();


--
-- TOC entry 8668 (class 2620 OID 89793)
-- Dependencies: 689 2018 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relaciongeoreferenciaciongrupoarmadoversion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relaciongeoreferenciaciongrupoarmadoversion FOR EACH ROW EXECUTE PROCEDURE relaciongeoreferenciaciongrupoarmadoversion_audit_fun();


--
-- TOC entry 8669 (class 2620 OID 89794)
-- Dependencies: 691 2019 8870
-- Name: relacionhistoricoprocesalfuenteinfo_audit; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionhistoricoprocesalfuenteinfo_audit AFTER INSERT OR DELETE OR UPDATE ON relacionhistoricoprocesalfuenteinfo FOR EACH ROW EXECUTE PROCEDURE relacionhistoricoprocesalfuenteinfo_audit_fun();


--
-- TOC entry 8670 (class 2620 OID 89795)
-- Dependencies: 693 2020 8870
-- Name: relacionidentificaciongrupoarmadofuenteinformacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionidentificaciongrupoarmadofuenteinformacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionidentificaciongrupoarmadofuenteinformacion FOR EACH ROW EXECUTE PROCEDURE relacionidentificaciongrupoarmadofuenteinformacion_audit_fun();


--
-- TOC entry 8671 (class 2620 OID 89796)
-- Dependencies: 695 2021 8870
-- Name: relacionidentificaciongrupoarmadoversion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionidentificaciongrupoarmadoversion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionidentificaciongrupoarmadoversion FOR EACH ROW EXECUTE PROCEDURE relacionidentificaciongrupoarmadoversion_audit_fun();


--
-- TOC entry 8672 (class 2620 OID 89797)
-- Dependencies: 697 2023 8870
-- Name: relacionmagistradoaudiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionmagistradoaudiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionmagistradoaudiencia FOR EACH ROW EXECUTE PROCEDURE relacionmagistradoaudiencia_audit_fun();


--
-- TOC entry 8673 (class 2620 OID 89798)
-- Dependencies: 699 2024 8870
-- Name: relacionnotificacioncorreopostulado_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionnotificacioncorreopostulado_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionnotificacioncorreopostulado FOR EACH ROW EXECUTE PROCEDURE relacionnotificacioncorreopostulado_audit_fun();


--
-- TOC entry 8674 (class 2620 OID 89799)
-- Dependencies: 701 2025 8870
-- Name: relacionperfilreporte_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionperfilreporte_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionperfilreporte FOR EACH ROW EXECUTE PROCEDURE relacionperfilreporte_audit_fun();


--
-- TOC entry 8675 (class 2620 OID 89800)
-- Dependencies: 703 2026 8870
-- Name: relacionpersonacompulsacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpersonacompulsacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpersonacompulsacion FOR EACH ROW EXECUTE PROCEDURE relacionpersonacompulsacion_audit_fun();


--
-- TOC entry 8556 (class 2620 OID 89801)
-- Dependencies: 332 2027 8870
-- Name: relacionpersonajuridicacolectividad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpersonajuridicacolectividad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpersonajuridicacolectividad FOR EACH ROW EXECUTE PROCEDURE relacionpersonajuridicacolectividad_audit_fun();


--
-- TOC entry 8676 (class 2620 OID 89802)
-- Dependencies: 707 2028 8870
-- Name: relacionpersonaparentesco_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpersonaparentesco_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpersonaparentesco FOR EACH ROW EXECUTE PROCEDURE relacionpersonaparentesco_audit_fun();


--
-- TOC entry 10903 (class 0 OID 0)
-- Dependencies: 8676
-- Name: TRIGGER relacionpersonaparentesco_trigger_fun ON relacionpersonaparentesco; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionpersonaparentesco_trigger_fun ON relacionpersonaparentesco IS 'Relacion persona parentesco';


--
-- TOC entry 8677 (class 2620 OID 89803)
-- Dependencies: 709 2029 8870
-- Name: relacionpostuladoacta_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpostuladoacta_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpostuladoacta FOR EACH ROW EXECUTE PROCEDURE relacionpostuladoacta_audit_fun();


--
-- TOC entry 8678 (class 2620 OID 89804)
-- Dependencies: 711 2030 8870
-- Name: relacionpostuladodocumentopostulacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpostuladodocumentopostulacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpostuladodocumentopostulacion FOR EACH ROW EXECUTE PROCEDURE relacionpostuladodocumentopostulacion_audit_fun();


--
-- TOC entry 8679 (class 2620 OID 89805)
-- Dependencies: 713 2031 8870
-- Name: relacionpostuladoversion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpostuladoversion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpostuladoversion FOR EACH ROW EXECUTE PROCEDURE relacionpostuladoversion_audit_fun();


--
-- TOC entry 8680 (class 2620 OID 89806)
-- Dependencies: 715 2032 8870
-- Name: relacionpublicacionexternapostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpublicacionexternapostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpublicacionexternapostulado FOR EACH ROW EXECUTE PROCEDURE relacionpublicacionexternapostulado_audit_fun();


--
-- TOC entry 8681 (class 2620 OID 89807)
-- Dependencies: 717 2033 8870
-- Name: relacionpublicacioninternapostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionpublicacioninternapostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionpublicacioninternapostulado FOR EACH ROW EXECUTE PROCEDURE relacionpublicacioninternapostulado_audit_fun();


--
-- TOC entry 8682 (class 2620 OID 89808)
-- Dependencies: 719 2034 8870
-- Name: relacionregistrohechodocumento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionregistrohechodocumento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionregistrohechodocumento FOR EACH ROW EXECUTE PROCEDURE relacionregistrohechodocumento_audit_fun();


--
-- TOC entry 10904 (class 0 OID 0)
-- Dependencies: 8682
-- Name: TRIGGER relacionregistrohechodocumento_trigger_fun ON relacionregistrohechodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionregistrohechodocumento_trigger_fun ON relacionregistrohechodocumento IS 'Relacion entre un Registro de un hecho y un Documento';


--
-- TOC entry 8683 (class 2620 OID 89809)
-- Dependencies: 721 2035 8870
-- Name: relacionreporteprogramacionreporte_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionreporteprogramacionreporte_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionreporteprogramacionreporte FOR EACH ROW EXECUTE PROCEDURE relacionreporteprogramacionreporte_audit_fun();


--
-- TOC entry 8684 (class 2620 OID 89810)
-- Dependencies: 723 2036 8870
-- Name: relacionsenalregion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionsenalregion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionsenalregion FOR EACH ROW EXECUTE PROCEDURE relacionsenalregion_audit_fun();


--
-- TOC entry 10905 (class 0 OID 0)
-- Dependencies: 8684
-- Name: TRIGGER relacionsenalregion_trigger_fun ON relacionsenalregion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionsenalregion_trigger_fun ON relacionsenalregion IS 'Tabla de la relacion se񡬠con un evento';


--
-- TOC entry 8685 (class 2620 OID 89811)
-- Dependencies: 725 2037 8870
-- Name: relacionversionevento_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionversionevento_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionversionevento FOR EACH ROW EXECUTE PROCEDURE relacionversionevento_audit_fun();


--
-- TOC entry 10906 (class 0 OID 0)
-- Dependencies: 8685
-- Name: TRIGGER relacionversionevento_audit_fun ON relacionversionevento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionversionevento_audit_fun ON relacionversionevento IS 'Relacion de la version con un evento';


--
-- TOC entry 8686 (class 2620 OID 89812)
-- Dependencies: 727 2038 8870
-- Name: relacionversionhistorialpga_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionversionhistorialpga_audit_fun AFTER INSERT OR DELETE OR UPDATE ON relacionversionhistorialpga FOR EACH ROW EXECUTE PROCEDURE relacionversionhistorialpga_audit_fun();


--
-- TOC entry 8687 (class 2620 OID 89813)
-- Dependencies: 729 2039 8870
-- Name: relacionvictimahecho_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER relacionvictimahecho_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON relacionvictimahecho FOR EACH ROW EXECUTE PROCEDURE relacionvictimahecho_audit_fun();


--
-- TOC entry 10907 (class 0 OID 0)
-- Dependencies: 8687
-- Name: TRIGGER relacionvictimahecho_trigger_fun ON relacionvictimahecho; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER relacionvictimahecho_trigger_fun ON relacionvictimahecho IS 'Relacion victima hecho';


--
-- TOC entry 8688 (class 2620 OID 89814)
-- Dependencies: 731 2040 8870
-- Name: religion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER religion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON religion FOR EACH ROW EXECUTE PROCEDURE religion_audit_fun();


--
-- TOC entry 8689 (class 2620 OID 89815)
-- Dependencies: 734 2041 8870
-- Name: reporte_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER reporte_audit_fun AFTER INSERT OR DELETE OR UPDATE ON reporte FOR EACH ROW EXECUTE PROCEDURE reporte_audit_fun();


--
-- TOC entry 8690 (class 2620 OID 89816)
-- Dependencies: 737 2042 8870
-- Name: reposicionterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER reposicionterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON reposicionterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE reposicionterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8691 (class 2620 OID 89817)
-- Dependencies: 739 2043 8870
-- Name: resolucionasignacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER resolucionasignacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON resolucionasignacion FOR EACH ROW EXECUTE PROCEDURE resolucionasignacion_audit_fun();


--
-- TOC entry 8692 (class 2620 OID 89818)
-- Dependencies: 744 2044 8870
-- Name: salaconocimiento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER salaconocimiento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON salaconocimiento FOR EACH ROW EXECUTE PROCEDURE salaconocimiento_audit_fun();


--
-- TOC entry 8693 (class 2620 OID 89819)
-- Dependencies: 747 2048 8870
-- Name: salaversion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER salaversion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON salaversion FOR EACH ROW EXECUTE PROCEDURE salaversion_audit_fun();


--
-- TOC entry 10908 (class 0 OID 0)
-- Dependencies: 8693
-- Name: TRIGGER salaversion_audit_fun ON salaversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER salaversion_audit_fun ON salaversion IS 'Salas de version de Justicia y Paz';


--
-- TOC entry 8694 (class 2620 OID 89820)
-- Dependencies: 753 2069 8870
-- Name: sentenciajyp_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER sentenciajyp_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON sentenciajyp FOR EACH ROW EXECUTE PROCEDURE sentenciajyp_audit_fun();


--
-- TOC entry 8695 (class 2620 OID 89821)
-- Dependencies: 756 2078 8870
-- Name: solicitudterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER solicitudterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON solicitudterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE solicitudterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8696 (class 2620 OID 89822)
-- Dependencies: 760 2098 8870
-- Name: tendenciasexual_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tendenciasexual_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tendenciasexual FOR EACH ROW EXECUTE PROCEDURE tendenciasexual_audit_fun();


--
-- TOC entry 8697 (class 2620 OID 89823)
-- Dependencies: 763 2099 8870
-- Name: terminacionetapaprocesal_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER terminacionetapaprocesal_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON terminacionetapaprocesal FOR EACH ROW EXECUTE PROCEDURE terminacionetapaprocesal_audit_fun();


--
-- TOC entry 8698 (class 2620 OID 89824)
-- Dependencies: 766 2103 8870
-- Name: tipoaccesosalud_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoaccesosalud_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoaccesosalud FOR EACH ROW EXECUTE PROCEDURE tipoaccesosalud_audit_fun();


--
-- TOC entry 8699 (class 2620 OID 89825)
-- Dependencies: 769 2104 8870
-- Name: tipoactaasignacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoactaasignacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoactaasignacion FOR EACH ROW EXECUTE PROCEDURE tipoactaasignacion_audit_fun();


--
-- TOC entry 8700 (class 2620 OID 89826)
-- Dependencies: 772 2105 8870
-- Name: tipoactuacionhistoricoprocesal_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoactuacionhistoricoprocesal_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoactuacionhistoricoprocesal FOR EACH ROW EXECUTE PROCEDURE tipoactuacionhistoricoprocesal_audit_fun();


--
-- TOC entry 8701 (class 2620 OID 89827)
-- Dependencies: 777 2106 8870
-- Name: tipoalbumfotografico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoalbumfotografico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoalbumfotografico FOR EACH ROW EXECUTE PROCEDURE tipoalbumfotografico_audit_fun();


--
-- TOC entry 8702 (class 2620 OID 89828)
-- Dependencies: 780 2107 8870
-- Name: tipoaplicaley_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoaplicaley_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoaplicaley FOR EACH ROW EXECUTE PROCEDURE tipoaplicaley_audit_fun();


--
-- TOC entry 8703 (class 2620 OID 89829)
-- Dependencies: 783 2108 8870
-- Name: tipoapoderado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoapoderado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoapoderado FOR EACH ROW EXECUTE PROCEDURE tipoapoderado_audit_fun();


--
-- TOC entry 10909 (class 0 OID 0)
-- Dependencies: 8703
-- Name: TRIGGER tipoapoderado_trigger_fun ON tipoapoderado; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipoapoderado_trigger_fun ON tipoapoderado IS 'Tipos de apoderado';


--
-- TOC entry 8704 (class 2620 OID 89830)
-- Dependencies: 786 2109 8870
-- Name: tipoaudiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoaudiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoaudiencia FOR EACH ROW EXECUTE PROCEDURE tipoaudiencia_audit_fun();


--
-- TOC entry 8705 (class 2620 OID 89831)
-- Dependencies: 792 2110 8870
-- Name: tipocaratula_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipocaratula_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipocaratula FOR EACH ROW EXECUTE PROCEDURE tipocaratula_audit_fun();


--
-- TOC entry 8706 (class 2620 OID 89832)
-- Dependencies: 795 2111 8870
-- Name: tipoclasificacionpersonajuridica_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoclasificacionpersonajuridica_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoclasificacionpersonajuridica FOR EACH ROW EXECUTE PROCEDURE tipoclasificacionpersonajuridica_audit_fun();


--
-- TOC entry 8707 (class 2620 OID 89833)
-- Dependencies: 798 2112 8870
-- Name: tipocompulsacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipocompulsacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipocompulsacion FOR EACH ROW EXECUTE PROCEDURE tipocompulsacion_audit_fun();


--
-- TOC entry 8708 (class 2620 OID 89834)
-- Dependencies: 803 2113 8870
-- Name: tipodiscapacidad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodiscapacidad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipodiscapacidad FOR EACH ROW EXECUTE PROCEDURE tipodiscapacidad_audit_fun();


--
-- TOC entry 8709 (class 2620 OID 89835)
-- Dependencies: 806 2114 8870
-- Name: tipodocumento_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumento_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumento FOR EACH ROW EXECUTE PROCEDURE tipodocumento_audit_fun();


--
-- TOC entry 10910 (class 0 OID 0)
-- Dependencies: 8709
-- Name: TRIGGER tipodocumento_trigger_fun ON tipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipodocumento_trigger_fun ON tipodocumento IS 'Tipos de documentos';


--
-- TOC entry 8710 (class 2620 OID 89836)
-- Dependencies: 809 2115 8870
-- Name: tipodocumentocarpeta_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentocarpeta_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentocarpeta FOR EACH ROW EXECUTE PROCEDURE tipodocumentocarpeta_audit_fun();


--
-- TOC entry 8711 (class 2620 OID 89837)
-- Dependencies: 812 2116 8870
-- Name: tipodocumentocompulsacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentocompulsacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentocompulsacion FOR EACH ROW EXECUTE PROCEDURE tipodocumentocompulsacion_audit_fun();


--
-- TOC entry 8712 (class 2620 OID 89838)
-- Dependencies: 816 2117 8870
-- Name: tipodocumentoedictoemplazatorio_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentoedictoemplazatorio_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentoedictoemplazatorio FOR EACH ROW EXECUTE PROCEDURE tipodocumentoedictoemplazatorio_audit_fun();


--
-- TOC entry 8713 (class 2620 OID 89839)
-- Dependencies: 820 2118 8870
-- Name: tipodocumentoidentidad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentoidentidad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentoidentidad FOR EACH ROW EXECUTE PROCEDURE tipodocumentoidentidad_audit_fun();


--
-- TOC entry 8714 (class 2620 OID 89840)
-- Dependencies: 822 2119 8870
-- Name: tipodocumentopersona_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentopersona_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentopersona FOR EACH ROW EXECUTE PROCEDURE tipodocumentopersona_audit_fun();


--
-- TOC entry 10911 (class 0 OID 0)
-- Dependencies: 8714
-- Name: TRIGGER tipodocumentopersona_trigger_fun ON tipodocumentopersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipodocumentopersona_trigger_fun ON tipodocumentopersona IS 'Tipos de documentos de persona';


--
-- TOC entry 8715 (class 2620 OID 89841)
-- Dependencies: 825 2120 8870
-- Name: tipodocumentopostulacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipodocumentopostulacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipodocumentopostulacion FOR EACH ROW EXECUTE PROCEDURE tipodocumentopostulacion_audit_fun();


--
-- TOC entry 8716 (class 2620 OID 89842)
-- Dependencies: 830 2121 8870
-- Name: tipoedad_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoedad_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoedad FOR EACH ROW EXECUTE PROCEDURE tipoedad_audit_fun();


--
-- TOC entry 10912 (class 0 OID 0)
-- Dependencies: 8716
-- Name: TRIGGER tipoedad_audit_fun ON tipoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipoedad_audit_fun ON tipoedad IS 'Tipos de edad';


--
-- TOC entry 8717 (class 2620 OID 89843)
-- Dependencies: 833 2122 8870
-- Name: tipoestadonotificacioncorreo_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoestadonotificacioncorreo_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoestadonotificacioncorreo FOR EACH ROW EXECUTE PROCEDURE tipoestadonotificacioncorreo_audit_fun();


--
-- TOC entry 8718 (class 2620 OID 89844)
-- Dependencies: 836 2123 8870
-- Name: tipoestadopersona_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoestadopersona_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoestadopersona FOR EACH ROW EXECUTE PROCEDURE tipoestadopersona_audit_fun();


--
-- TOC entry 8719 (class 2620 OID 89845)
-- Dependencies: 838 2124 8870
-- Name: tipofecha_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipofecha_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipofecha FOR EACH ROW EXECUTE PROCEDURE tipofecha_audit_fun();


--
-- TOC entry 10913 (class 0 OID 0)
-- Dependencies: 8719
-- Name: TRIGGER tipofecha_audit_fun ON tipofecha; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipofecha_audit_fun ON tipofecha IS 'Tipos de fecha';


--
-- TOC entry 8720 (class 2620 OID 89846)
-- Dependencies: 841 2125 8870
-- Name: tipofenomenohistorico_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipofenomenohistorico_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipofenomenohistorico FOR EACH ROW EXECUTE PROCEDURE tipofenomenohistorico_audit_fun();


--
-- TOC entry 8721 (class 2620 OID 89847)
-- Dependencies: 845 2126 8870
-- Name: tipohechoversion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipohechoversion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipohechoversion FOR EACH ROW EXECUTE PROCEDURE tipohechoversion_audit_fun();


--
-- TOC entry 10914 (class 0 OID 0)
-- Dependencies: 8721
-- Name: TRIGGER tipohechoversion_audit_fun ON tipohechoversion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipohechoversion_audit_fun ON tipohechoversion IS 'Tipo del hecho dentro de la version';


--
-- TOC entry 8722 (class 2620 OID 89848)
-- Dependencies: 848 2127 8870
-- Name: tipohistorialreclusion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipohistorialreclusion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipohistorialreclusion FOR EACH ROW EXECUTE PROCEDURE tipohistorialreclusion_audit_fun();


--
-- TOC entry 8723 (class 2620 OID 89849)
-- Dependencies: 851 2128 8870
-- Name: tipoidentificaciongrupoarmado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoidentificaciongrupoarmado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoidentificaciongrupoarmado FOR EACH ROW EXECUTE PROCEDURE tipoidentificaciongrupoarmado_audit_fun();


--
-- TOC entry 8724 (class 2620 OID 89850)
-- Dependencies: 854 2129 8870
-- Name: tipoinactivopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoinactivopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoinactivopostulado FOR EACH ROW EXECUTE PROCEDURE tipoinactivopostulado_audit_fun();


--
-- TOC entry 8725 (class 2620 OID 89851)
-- Dependencies: 857 2130 8870
-- Name: tipojefe_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipojefe_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipojefe FOR EACH ROW EXECUTE PROCEDURE tipojefe_audit_fun();


--
-- TOC entry 8726 (class 2620 OID 89852)
-- Dependencies: 859 2131 8870
-- Name: tipoley_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoley_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoley FOR EACH ROW EXECUTE PROCEDURE tipoley_audit_fun();


--
-- TOC entry 8727 (class 2620 OID 89853)
-- Dependencies: 862 2132 8870
-- Name: tipomediopublicacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipomediopublicacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipomediopublicacion FOR EACH ROW EXECUTE PROCEDURE tipomediopublicacion_audit_fun();


--
-- TOC entry 8728 (class 2620 OID 89854)
-- Dependencies: 865 2133 8870
-- Name: tipomoneda_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipomoneda_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipomoneda FOR EACH ROW EXECUTE PROCEDURE tipomoneda_audit_fun();


--
-- TOC entry 8729 (class 2620 OID 89855)
-- Dependencies: 868 2134 8870
-- Name: tiponivelsisben_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiponivelsisben_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tiponivelsisben FOR EACH ROW EXECUTE PROCEDURE tiponivelsisben_audit_fun();


--
-- TOC entry 8730 (class 2620 OID 89856)
-- Dependencies: 871 2135 8870
-- Name: tipoorigenfuenteinformacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoorigenfuenteinformacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoorigenfuenteinformacion FOR EACH ROW EXECUTE PROCEDURE tipoorigenfuenteinformacion_audit_fun();


--
-- TOC entry 10915 (class 0 OID 0)
-- Dependencies: 8730
-- Name: TRIGGER tipoorigenfuenteinformacion_audit_fun ON tipoorigenfuenteinformacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipoorigenfuenteinformacion_audit_fun ON tipoorigenfuenteinformacion IS 'Tipos de origen de la fuente de informaci󮠤el proceso de Justicia y Paz';


--
-- TOC entry 8731 (class 2620 OID 89857)
-- Dependencies: 874 2136 8870
-- Name: tipoparticipacion_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoparticipacion_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoparticipacion FOR EACH ROW EXECUTE PROCEDURE tipoparticipacion_audit_fun();


--
-- TOC entry 10916 (class 0 OID 0)
-- Dependencies: 8731
-- Name: TRIGGER tipoparticipacion_audit_fun ON tipoparticipacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipoparticipacion_audit_fun ON tipoparticipacion IS 'Tipo de participacion de un autor en un hecho';


--
-- TOC entry 8732 (class 2620 OID 89858)
-- Dependencies: 877 2137 8870
-- Name: tipoparticipanteaudiencia_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoparticipanteaudiencia_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoparticipanteaudiencia FOR EACH ROW EXECUTE PROCEDURE tipoparticipanteaudiencia_audit_fun();


--
-- TOC entry 8733 (class 2620 OID 89859)
-- Dependencies: 880 2138 8870
-- Name: tipoperfilfotopersona_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoperfilfotopersona_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoperfilfotopersona FOR EACH ROW EXECUTE PROCEDURE tipoperfilfotopersona_audit_fun();


--
-- TOC entry 8734 (class 2620 OID 89860)
-- Dependencies: 885 2139 8870
-- Name: tipopostulado_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipopostulado_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipopostulado FOR EACH ROW EXECUTE PROCEDURE tipopostulado_audit_fun();


--
-- TOC entry 8735 (class 2620 OID 89861)
-- Dependencies: 888 2140 8870
-- Name: tipopreclusionpostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipopreclusionpostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipopreclusionpostulado FOR EACH ROW EXECUTE PROCEDURE tipopreclusionpostulado_audit_fun();


--
-- TOC entry 8736 (class 2620 OID 89862)
-- Dependencies: 891 2141 8870
-- Name: tipoprocesojyp_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoprocesojyp_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoprocesojyp FOR EACH ROW EXECUTE PROCEDURE tipoprocesojyp_audit_fun();


--
-- TOC entry 8737 (class 2620 OID 89863)
-- Dependencies: 894 2142 8870
-- Name: tiporangoedad_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiporangoedad_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tiporangoedad FOR EACH ROW EXECUTE PROCEDURE tiporangoedad_audit_fun();


--
-- TOC entry 10917 (class 0 OID 0)
-- Dependencies: 8737
-- Name: TRIGGER tiporangoedad_audit_fun ON tiporangoedad; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tiporangoedad_audit_fun ON tiporangoedad IS 'Tabla de tipo de rango de edad';


--
-- TOC entry 8738 (class 2620 OID 89864)
-- Dependencies: 897 2143 8870
-- Name: tiporelacionevento_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiporelacionevento_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tiporelacionevento FOR EACH ROW EXECUTE PROCEDURE tiporelacionevento_audit_fun();


--
-- TOC entry 8739 (class 2620 OID 89865)
-- Dependencies: 902 2144 8870
-- Name: tiporelacionpersonajuridicacolectividad_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiporelacionpersonajuridicacolectividad_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tiporelacionpersonajuridicacolectividad FOR EACH ROW EXECUTE PROCEDURE tiporelacionpersonajuridicacolectividad_audit_fun();


--
-- TOC entry 8740 (class 2620 OID 89866)
-- Dependencies: 905 2145 8870
-- Name: tiposectortrabajo_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiposectortrabajo_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tiposectortrabajo FOR EACH ROW EXECUTE PROCEDURE tiposectortrabajo_audit_fun();


--
-- TOC entry 8741 (class 2620 OID 89867)
-- Dependencies: 908 2146 8870
-- Name: tiposubclasificacionpersonajuridica_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tiposubclasificacionpersonajuridica_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tiposubclasificacionpersonajuridica FOR EACH ROW EXECUTE PROCEDURE tiposubclasificacionpersonajuridica_audit_fun();


--
-- TOC entry 8742 (class 2620 OID 89868)
-- Dependencies: 911 2147 8870
-- Name: tipoterminacionprocesopostulado_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoterminacionprocesopostulado_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoterminacionprocesopostulado FOR EACH ROW EXECUTE PROCEDURE tipoterminacionprocesopostulado_audit_fun();


--
-- TOC entry 8743 (class 2620 OID 89869)
-- Dependencies: 916 2148 8870
-- Name: tipotrabajo_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipotrabajo_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipotrabajo FOR EACH ROW EXECUTE PROCEDURE tipotrabajo_audit_fun();


--
-- TOC entry 8744 (class 2620 OID 89870)
-- Dependencies: 920 2149 8870
-- Name: tipoubicacion_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoubicacion_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON tipoubicacion FOR EACH ROW EXECUTE PROCEDURE tipoubicacion_audit_fun();


--
-- TOC entry 8745 (class 2620 OID 89871)
-- Dependencies: 924 2150 8870
-- Name: tipoubicacioncuerpo_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER tipoubicacioncuerpo_audit_fun AFTER INSERT OR DELETE OR UPDATE ON tipoubicacioncuerpo FOR EACH ROW EXECUTE PROCEDURE tipoubicacioncuerpo_audit_fun();


--
-- TOC entry 10918 (class 0 OID 0)
-- Dependencies: 8745
-- Name: TRIGGER tipoubicacioncuerpo_audit_fun ON tipoubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER tipoubicacioncuerpo_audit_fun ON tipoubicacioncuerpo IS 'Tabla del tipo de ubicacion del cuerpo';


--
-- TOC entry 8746 (class 2620 OID 89872)
-- Dependencies: 927 2151 8870
-- Name: titularbien_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER titularbien_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON titularbien FOR EACH ROW EXECUTE PROCEDURE titularbien_audit_fun();


--
-- TOC entry 10919 (class 0 OID 0)
-- Dependencies: 8746
-- Name: TRIGGER titularbien_trigger_fun ON titularbien; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER titularbien_trigger_fun ON titularbien IS 'Identificacion del titular de un bien';


--
-- TOC entry 8747 (class 2620 OID 89873)
-- Dependencies: 929 2152 8870
-- Name: trabajo_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER trabajo_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON trabajo FOR EACH ROW EXECUTE PROCEDURE trabajo_audit_fun();


--
-- TOC entry 10920 (class 0 OID 0)
-- Dependencies: 8747
-- Name: TRIGGER trabajo_trigger_fun ON trabajo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER trabajo_trigger_fun ON trabajo IS 'Trababjo de persona';


--
-- TOC entry 8748 (class 2620 OID 89874)
-- Dependencies: 932 2153 8870
-- Name: ubicacioncuerpo_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER ubicacioncuerpo_audit_fun AFTER INSERT OR DELETE OR UPDATE ON ubicacioncuerpo FOR EACH ROW EXECUTE PROCEDURE ubicacioncuerpo_audit_fun();


--
-- TOC entry 10921 (class 0 OID 0)
-- Dependencies: 8748
-- Name: TRIGGER ubicacioncuerpo_audit_fun ON ubicacioncuerpo; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER ubicacioncuerpo_audit_fun ON ubicacioncuerpo IS 'Ubicacion geografica de un cuerpo';


--
-- TOC entry 8552 (class 2620 OID 89875)
-- Dependencies: 329 2157 8870
-- Name: usuario_trigger_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER usuario_trigger_fun AFTER INSERT OR DELETE OR UPDATE ON usuario FOR EACH ROW EXECUTE PROCEDURE usuario_audit_fun();


--
-- TOC entry 10922 (class 0 OID 0)
-- Dependencies: 8552
-- Name: TRIGGER usuario_trigger_fun ON usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER usuario_trigger_fun ON usuario IS 'Usuario del Sistema de Informacion Justicia y Paz';


--
-- TOC entry 8749 (class 2620 OID 89876)
-- Dependencies: 940 2169 8870
-- Name: version_audit_fun; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER version_audit_fun AFTER INSERT OR DELETE OR UPDATE ON version FOR EACH ROW EXECUTE PROCEDURE version_audit_fun();


--
-- TOC entry 10923 (class 0 OID 0)
-- Dependencies: 8749
-- Name: TRIGGER version_audit_fun ON version; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TRIGGER version_audit_fun ON version IS 'Version del proceso de Justicia y paz';


--
-- TOC entry 8130 (class 2606 OID 89877)
-- Dependencies: 7587 475 475 8870
-- Name: FK_eventorelacionado_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT "FK_eventorelacionado_1" FOREIGN KEY (ideventorelacionado) REFERENCES evento(idevento);


--
-- TOC entry 7996 (class 2606 OID 89882)
-- Dependencies: 7503 368 335 8870
-- Name: acta_asignacion_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 7997 (class 2606 OID 89887)
-- Dependencies: 7482 329 335 8870
-- Name: acta_asignacion_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 7998 (class 2606 OID 89892)
-- Dependencies: 7820 769 335 8870
-- Name: acta_asignacion_idtipoactaasignacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_idtipoactaasignacion_fkey FOREIGN KEY (idtipoactaasignacion) REFERENCES tipoactaasignacion(idtipoactaasignacion);


--
-- TOC entry 7999 (class 2606 OID 89897)
-- Dependencies: 7880 857 335 8870
-- Name: acta_asignacion_idtipojefe_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_idtipojefe_fkey FOREIGN KEY (idtipojefe) REFERENCES tipojefe(idtipojefe);


--
-- TOC entry 8000 (class 2606 OID 89902)
-- Dependencies: 7482 329 335 8870
-- Name: acta_asignacion_jefeunidad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT acta_asignacion_jefeunidad_fkey FOREIGN KEY (jefeunidad) REFERENCES usuario(login);


--
-- TOC entry 8002 (class 2606 OID 89907)
-- Dependencies: 7503 368 338 8870
-- Name: actareasignacion_despachoanterior_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_despachoanterior_fkey FOREIGN KEY (despachoanterior) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8003 (class 2606 OID 89912)
-- Dependencies: 7509 375 338 8870
-- Name: actareasignacion_idbloqueanterior_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idbloqueanterior_fkey FOREIGN KEY (idbloqueanterior) REFERENCES bloque(idbloque);


--
-- TOC entry 8004 (class 2606 OID 89917)
-- Dependencies: 7509 375 338 8870
-- Name: actareasignacion_idbloquenuevo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idbloquenuevo_fkey FOREIGN KEY (idbloquenuevo) REFERENCES bloque(idbloque);


--
-- TOC entry 8005 (class 2606 OID 89922)
-- Dependencies: 7576 465 338 8870
-- Name: actareasignacion_idestructuraanterior_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idestructuraanterior_fkey FOREIGN KEY (idestructuraanterior) REFERENCES estructura(idestructura);


--
-- TOC entry 8006 (class 2606 OID 89927)
-- Dependencies: 7576 465 338 8870
-- Name: actareasignacion_idestructuranueva_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idestructuranueva_fkey FOREIGN KEY (idestructuranueva) REFERENCES estructura(idestructura);


--
-- TOC entry 8007 (class 2606 OID 89932)
-- Dependencies: 7595 488 338 8870
-- Name: actareasignacion_idfrenteanterior_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idfrenteanterior_fkey FOREIGN KEY (idfrenteanterior) REFERENCES frente(idfrente);


--
-- TOC entry 8008 (class 2606 OID 89937)
-- Dependencies: 7595 488 338 8870
-- Name: actareasignacion_idfrentenuevo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idfrentenuevo_fkey FOREIGN KEY (idfrentenuevo) REFERENCES frente(idfrente);


--
-- TOC entry 8009 (class 2606 OID 89942)
-- Dependencies: 7611 510 338 8870
-- Name: actareasignacion_idgrupoarmadoanterior_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idgrupoarmadoanterior_fkey FOREIGN KEY (idgrupoarmadoanterior) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8010 (class 2606 OID 89947)
-- Dependencies: 7611 510 338 8870
-- Name: actareasignacion_idgrupoarmadonuevo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_idgrupoarmadonuevo_fkey FOREIGN KEY (idgrupoarmadonuevo) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8011 (class 2606 OID 89952)
-- Dependencies: 7482 329 338 8870
-- Name: actareasignacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actareasignacion
    ADD CONSTRAINT actareasignacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8306 (class 2606 OID 89957)
-- Dependencies: 7496 346 640 8870
-- Name: albumfotografico_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionalbumfotograficofoto
    ADD CONSTRAINT albumfotografico_fk FOREIGN KEY (idalbumfotografico) REFERENCES albumfotografico(idalbumfotografico);


--
-- TOC entry 8024 (class 2606 OID 89962)
-- Dependencies: 7532 404 353 8870
-- Name: apelacionterminacionprocesopostulado_iddecisionterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apelacionterminacionprocesopostulado
    ADD CONSTRAINT apelacionterminacionprocesopostulado_iddecisionterminacion_fkey FOREIGN KEY (iddecisionterminacion) REFERENCES decisionterminacionprocesopostulado(iddecisionterminacion);


--
-- TOC entry 8023 (class 2606 OID 89967)
-- Dependencies: 7482 329 353 8870
-- Name: apelacionterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apelacionterminacionprocesopostulado
    ADD CONSTRAINT apelacionterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8028 (class 2606 OID 89972)
-- Dependencies: 7480 328 355 8870
-- Name: apoderado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apoderado
    ADD CONSTRAINT apoderado_fk FOREIGN KEY (idpersonaapoderado) REFERENCES persona(idpersona);


--
-- TOC entry 8029 (class 2606 OID 89977)
-- Dependencies: 7503 368 357 8870
-- Name: asignaciongrupoarmado_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8030 (class 2606 OID 89982)
-- Dependencies: 7482 329 357 8870
-- Name: asignaciongrupoarmado_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8031 (class 2606 OID 89987)
-- Dependencies: 7509 375 357 8870
-- Name: asignaciongrupoarmado_idbloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_idbloque_fkey FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8032 (class 2606 OID 89992)
-- Dependencies: 7576 465 357 8870
-- Name: asignaciongrupoarmado_idestructura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_idestructura_fkey FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8033 (class 2606 OID 89997)
-- Dependencies: 7595 488 357 8870
-- Name: asignaciongrupoarmado_idfrente_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_idfrente_fkey FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8034 (class 2606 OID 90002)
-- Dependencies: 7611 510 357 8870
-- Name: asignaciongrupoarmado_idgrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_idgrupoarmado_fkey FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8035 (class 2606 OID 90007)
-- Dependencies: 7796 739 357 8870
-- Name: asignaciongrupoarmado_idresolucionasignacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_idresolucionasignacion_fkey FOREIGN KEY (idresolucionasignacion) REFERENCES resolucionasignacion(idresolucionasignacion);


--
-- TOC entry 8036 (class 2606 OID 90012)
-- Dependencies: 7482 329 357 8870
-- Name: asignaciongrupoarmado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asignaciongrupoarmado
    ADD CONSTRAINT asignaciongrupoarmado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8038 (class 2606 OID 90017)
-- Dependencies: 7478 326 364 8870
-- Name: audiencia_idmagistrado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY audiencia
    ADD CONSTRAINT audiencia_idmagistrado_fkey FOREIGN KEY (idmagistradoponente) REFERENCES magistrado(idmagistrado);


--
-- TOC entry 8053 (class 2606 OID 90022)
-- Dependencies: 7503 368 382 8870
-- Name: autoridad_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT autoridad_fk FOREIGN KEY (idautoridad) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8095 (class 2606 OID 90027)
-- Dependencies: 7503 368 422 8870
-- Name: autoridad_pk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT autoridad_pk FOREIGN KEY (idautoridad) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8048 (class 2606 OID 90032)
-- Dependencies: 7482 329 372 8870
-- Name: bienesentregadosdesmovilizacionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bienesentregadosdesmovilizacion
    ADD CONSTRAINT bienesentregadosdesmovilizacionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8047 (class 2606 OID 90037)
-- Dependencies: 7505 370 372 8870
-- Name: bienesentregadosfk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bienesentregadosdesmovilizacion
    ADD CONSTRAINT bienesentregadosfk_1 FOREIGN KEY (idbien) REFERENCES bien(idbien);


--
-- TOC entry 8046 (class 2606 OID 90042)
-- Dependencies: 7540 414 372 8870
-- Name: bienesentregadosfk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bienesentregadosdesmovilizacion
    ADD CONSTRAINT bienesentregadosfk_2 FOREIGN KEY (iddesmovilizacion) REFERENCES desmovilizacion(iddesmovilizacion);


--
-- TOC entry 8039 (class 2606 OID 90047)
-- Dependencies: 7564 448 370 8870
-- Name: bienfk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_1 FOREIGN KEY (idelemento) REFERENCES elemento(idelemento);


--
-- TOC entry 8040 (class 2606 OID 90052)
-- Dependencies: 7656 576 370 8870
-- Name: bienfk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_2 FOREIGN KEY (idorigen) REFERENCES origen(idorigen);


--
-- TOC entry 8041 (class 2606 OID 90057)
-- Dependencies: 7824 775 370 8870
-- Name: bienfk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_3 FOREIGN KEY (idtipoadquisicion) REFERENCES tipoadquisicion(idtipoadquisicion);


--
-- TOC entry 8042 (class 2606 OID 90062)
-- Dependencies: 7664 588 370 8870
-- Name: bienfk_4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_4 FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8043 (class 2606 OID 90067)
-- Dependencies: 7538 413 370 8870
-- Name: bienfk_5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_5 FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8044 (class 2606 OID 90072)
-- Dependencies: 7646 564 370 8870
-- Name: bienfk_6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_6 FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8045 (class 2606 OID 90077)
-- Dependencies: 7482 329 370 8870
-- Name: bienfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bien
    ADD CONSTRAINT bienfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7971 (class 2606 OID 90082)
-- Dependencies: 7509 375 331 8870
-- Name: bloque_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT bloque_fk FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8016 (class 2606 OID 90087)
-- Dependencies: 7509 375 346 8870
-- Name: bloque_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT bloque_fk FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8049 (class 2606 OID 90092)
-- Dependencies: 7576 465 375 8870
-- Name: bloquefk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bloque
    ADD CONSTRAINT bloquefk1 FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8321 (class 2606 OID 90097)
-- Dependencies: 7511 377 651 8870
-- Name: calidadvictima_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT calidadvictima_fk FOREIGN KEY (idcalidadvictima) REFERENCES calidadvictima(idcalidadvictima);


--
-- TOC entry 8052 (class 2606 OID 90102)
-- Dependencies: 7634 543 378 8870
-- Name: caracteristicafk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY caracteristica
    ADD CONSTRAINT caracteristicafk_2 FOREIGN KEY (idcaracteristica) REFERENCES listacaracteristica(idcaracteristica);


--
-- TOC entry 8051 (class 2606 OID 90107)
-- Dependencies: 7505 370 378 8870
-- Name: caracteristicafk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY caracteristica
    ADD CONSTRAINT caracteristicafk_3 FOREIGN KEY (idbien) REFERENCES bien(idbien);


--
-- TOC entry 8050 (class 2606 OID 90112)
-- Dependencies: 7482 329 378 8870
-- Name: caracteristicafk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY caracteristica
    ADD CONSTRAINT caracteristicafk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8332 (class 2606 OID 90117)
-- Dependencies: 7517 382 655 8870
-- Name: carpetahecho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncarpetahechoevento
    ADD CONSTRAINT carpetahecho_fk FOREIGN KEY (idcarpetahecho) REFERENCES carpetahecho(idcarpetahecho);


--
-- TOC entry 8060 (class 2606 OID 90122)
-- Dependencies: 7918 911 385 8870
-- Name: causaterminacionprocesopostulado_idtipoterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY causaterminacionprocesopostulado
    ADD CONSTRAINT causaterminacionprocesopostulado_idtipoterminacion_fkey FOREIGN KEY (idtipoterminacion) REFERENCES tipoterminacionprocesopostulado(idtipoterminacion);


--
-- TOC entry 8059 (class 2606 OID 90127)
-- Dependencies: 7482 329 385 8870
-- Name: causaterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY causaterminacionprocesopostulado
    ADD CONSTRAINT causaterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8131 (class 2606 OID 90132)
-- Dependencies: 7525 394 475 8870
-- Name: connotacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT connotacion_fk FOREIGN KEY (idconnotacion) REFERENCES connotacion(idconnotacion);


--
-- TOC entry 8069 (class 2606 OID 90137)
-- Dependencies: 7503 368 404 8870
-- Name: decisionterminacionprocesopostulado_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8070 (class 2606 OID 90142)
-- Dependencies: 7482 329 404 8870
-- Name: decisionterminacionprocesopostulado_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8071 (class 2606 OID 90147)
-- Dependencies: 7800 744 404 8870
-- Name: decisionterminacionprocesopostulado_idsalaconocimiento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_idsalaconocimiento_fkey FOREIGN KEY (idsalaconocimiento) REFERENCES salaconocimiento(idsalaconocimiento);


--
-- TOC entry 8072 (class 2606 OID 90152)
-- Dependencies: 7810 756 404 8870
-- Name: decisionterminacionprocesopostulado_idsolicitudterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_idsolicitudterminacion_fkey FOREIGN KEY (idsolicitudterminacion) REFERENCES solicitudterminacionprocesopostulado(idsolicitudterminacion);


--
-- TOC entry 8073 (class 2606 OID 90157)
-- Dependencies: 7482 329 404 8870
-- Name: decisionterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY decisionterminacionprocesopostulado
    ADD CONSTRAINT decisionterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8075 (class 2606 OID 90162)
-- Dependencies: 7812 759 408 8870
-- Name: delito_idsubtipodelito_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY delito
    ADD CONSTRAINT delito_idsubtipodelito_fkey FOREIGN KEY (idsubtipodelito) REFERENCES subtipodelito(idsubtipodelito) ON UPDATE CASCADE;


--
-- TOC entry 8074 (class 2606 OID 90167)
-- Dependencies: 7482 329 408 8870
-- Name: delitofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY delito
    ADD CONSTRAINT delitofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8077 (class 2606 OID 90172)
-- Dependencies: 7482 329 410 8870
-- Name: denunciaadicionalfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY denunciaadicional
    ADD CONSTRAINT denunciaadicionalfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8054 (class 2606 OID 90177)
-- Dependencies: 7538 413 382 8870
-- Name: departamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT departamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8096 (class 2606 OID 90182)
-- Dependencies: 7538 413 422 8870
-- Name: departamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT departamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8111 (class 2606 OID 90187)
-- Dependencies: 7538 413 437 8870
-- Name: departamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT departamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8078 (class 2606 OID 90192)
-- Dependencies: 7664 588 413 8870
-- Name: departamento_idpais_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY departamento
    ADD CONSTRAINT departamento_idpais_fkey FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8132 (class 2606 OID 90197)
-- Dependencies: 7538 413 475 8870
-- Name: deptoeventofk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT deptoeventofk3 FOREIGN KEY (departamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8079 (class 2606 OID 90202)
-- Dependencies: 7611 510 414 8870
-- Name: desmovilizacion5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacion5 FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8080 (class 2606 OID 90207)
-- Dependencies: 7538 413 414 8870
-- Name: desmovilizacionfk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk2 FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8081 (class 2606 OID 90212)
-- Dependencies: 7646 564 414 8870
-- Name: desmovilizacionfk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk3 FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8082 (class 2606 OID 90217)
-- Dependencies: 7521 389 414 8870
-- Name: desmovilizacionfk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk4 FOREIGN KEY (idclasedesmovilizacion) REFERENCES clasedesmovilizacion(idclasedesmovilizacion);


--
-- TOC entry 8083 (class 2606 OID 90222)
-- Dependencies: 7509 375 414 8870
-- Name: desmovilizacionfk6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk6 FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8084 (class 2606 OID 90227)
-- Dependencies: 7595 488 414 8870
-- Name: desmovilizacionfk7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk7 FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8085 (class 2606 OID 90232)
-- Dependencies: 7576 465 414 8870
-- Name: desmovilizacionfk8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk8 FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8086 (class 2606 OID 90237)
-- Dependencies: 7480 328 414 8870
-- Name: desmovilizacionfk9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk9 FOREIGN KEY (idmiembrorepresentante) REFERENCES persona(idpersona);


--
-- TOC entry 8087 (class 2606 OID 90242)
-- Dependencies: 7482 329 414 8870
-- Name: desmovilizacionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT desmovilizacionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8092 (class 2606 OID 90247)
-- Dependencies: 7540 414 417 8870
-- Name: desmovilizadofk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizado
    ADD CONSTRAINT desmovilizadofk2 FOREIGN KEY (iddesmovilizacion) REFERENCES desmovilizacion(iddesmovilizacion);


--
-- TOC entry 8091 (class 2606 OID 90252)
-- Dependencies: 7482 329 417 8870
-- Name: desmovilizadofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizado
    ADD CONSTRAINT desmovilizadofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8090 (class 2606 OID 90257)
-- Dependencies: 7480 328 417 8870
-- Name: desmovilizadokf1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizado
    ADD CONSTRAINT desmovilizadokf1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 7972 (class 2606 OID 90262)
-- Dependencies: 7503 368 331 8870
-- Name: despacho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT despacho_fk FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8364 (class 2606 OID 90267)
-- Dependencies: 7503 368 675 8870
-- Name: despacho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfiscaldespachoversion
    ADD CONSTRAINT despacho_fk FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8088 (class 2606 OID 90272)
-- Dependencies: 7664 588 414 8870
-- Name: despovilizacionfk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizacion
    ADD CONSTRAINT despovilizacionfk1 FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8426 (class 2606 OID 90277)
-- Dependencies: 7546 422 719 8870
-- Name: documento_pk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionregistrohechodocumento
    ADD CONSTRAINT documento_pk FOREIGN KEY (iddocumento) REFERENCES documento(iddocumento);


--
-- TOC entry 8104 (class 2606 OID 90282)
-- Dependencies: 7517 382 425 8870
-- Name: documentocarpeta_idcarpeta_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocarpeta
    ADD CONSTRAINT documentocarpeta_idcarpeta_fkey FOREIGN KEY (idcarpeta) REFERENCES carpetahecho(idcarpetahecho);


--
-- TOC entry 8107 (class 2606 OID 90287)
-- Dependencies: 7523 391 428 8870
-- Name: documentocompulsacion_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocompulsacion
    ADD CONSTRAINT documentocompulsacion_fk1 FOREIGN KEY (idcompulsacion) REFERENCES compulsacion(idcompulsacion);


--
-- TOC entry 8106 (class 2606 OID 90292)
-- Dependencies: 7544 419 428 8870
-- Name: documentocompulsacion_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocompulsacion
    ADD CONSTRAINT documentocompulsacion_fk2 FOREIGN KEY (iddespacho) REFERENCES despacho(iddespacho);


--
-- TOC entry 8105 (class 2606 OID 90297)
-- Dependencies: 7850 812 428 8870
-- Name: documentocompulsacion_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocompulsacion
    ADD CONSTRAINT documentocompulsacion_fk3 FOREIGN KEY (idtipodocumentocompulsacion) REFERENCES tipodocumentocompulsacion(idtipodocumentocompulsacion);


--
-- TOC entry 8108 (class 2606 OID 90302)
-- Dependencies: 7820 769 432 8870
-- Name: documentocuerpotipoacta_idtipoactaasignacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocuerpotipoacta
    ADD CONSTRAINT documentocuerpotipoacta_idtipoactaasignacion_fkey FOREIGN KEY (idtipoactaasignacion) REFERENCES tipoactaasignacion(idtipoactaasignacion);


--
-- TOC entry 8110 (class 2606 OID 90307)
-- Dependencies: 7852 816 434 8870
-- Name: documentoedictoemplazatorio_idtipodocumentoedictoemplazato_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentoedictoemplazatorio
    ADD CONSTRAINT documentoedictoemplazatorio_idtipodocumentoedictoemplazato_fkey FOREIGN KEY (idtipodocumentoedictoemplazatorio) REFERENCES tipodocumentoedictoemplazatorio(idtipodocumentoedictoemplazatorio);


--
-- TOC entry 8109 (class 2606 OID 90312)
-- Dependencies: 7482 329 434 8870
-- Name: documentoedictoemplazatorio_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentoedictoemplazatorio
    ADD CONSTRAINT documentoedictoemplazatorio_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8119 (class 2606 OID 90317)
-- Dependencies: 7482 329 443 8870
-- Name: documentospostulacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentospostulacion
    ADD CONSTRAINT documentospostulacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8120 (class 2606 OID 90322)
-- Dependencies: 7820 769 446 8870
-- Name: documentotipoacta_idtipoactaasignacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentotipoacta
    ADD CONSTRAINT documentotipoacta_idtipoactaasignacion_fkey FOREIGN KEY (idtipoactaasignacion) REFERENCES tipoactaasignacion(idtipoactaasignacion);


--
-- TOC entry 7973 (class 2606 OID 90327)
-- Dependencies: 7576 465 331 8870
-- Name: estructura_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT estructura_fk FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8017 (class 2606 OID 90332)
-- Dependencies: 7576 465 346 8870
-- Name: estructura_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT estructura_fk FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8125 (class 2606 OID 90337)
-- Dependencies: 7611 510 465 8870
-- Name: estructurafk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estructura
    ADD CONSTRAINT estructurafk1 FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8331 (class 2606 OID 90342)
-- Dependencies: 7578 466 655 8870
-- Name: etapaflujoinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncarpetahechoevento
    ADD CONSTRAINT etapaflujoinformacion_fk FOREIGN KEY (idetapaflujoinformacion) REFERENCES etapaflujoinformacion(idetapaflujoinformacion);


--
-- TOC entry 7974 (class 2606 OID 90347)
-- Dependencies: 7582 472 331 8870
-- Name: etapaproceso_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT etapaproceso_fk FOREIGN KEY (idetapaproceso) REFERENCES etapaproceso(idetapaproceso);


--
-- TOC entry 8549 (class 2606 OID 90352)
-- Dependencies: 7582 472 940 8870
-- Name: etapaproceso_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY version
    ADD CONSTRAINT etapaproceso_fk FOREIGN KEY (etapaproceso) REFERENCES etapaproceso(idetapaproceso);


--
-- TOC entry 8437 (class 2606 OID 90357)
-- Dependencies: 7587 475 725 8870
-- Name: evento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionevento
    ADD CONSTRAINT evento_fk FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8330 (class 2606 OID 90362)
-- Dependencies: 7587 475 655 8870
-- Name: evento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncarpetahechoevento
    ADD CONSTRAINT evento_fk FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8133 (class 2606 OID 90367)
-- Dependencies: 7828 780 475 8870
-- Name: evento_idaplicaley_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT evento_idaplicaley_fkey FOREIGN KEY (idaplicaley) REFERENCES tipoaplicaley(idtipoaplicaley);


--
-- TOC entry 8134 (class 2606 OID 90372)
-- Dependencies: 7482 329 475 8870
-- Name: eventofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT eventofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8135 (class 2606 OID 90377)
-- Dependencies: 7664 588 475 8870
-- Name: eventopaisfk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT eventopaisfk2 FOREIGN KEY (pais) REFERENCES pais(idpais);


--
-- TOC entry 7975 (class 2606 OID 90382)
-- Dependencies: 7482 329 331 8870
-- Name: fiscal_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT fiscal_fk FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8055 (class 2606 OID 90387)
-- Dependencies: 7482 329 382 8870
-- Name: fiscal_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT fiscal_fk FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8363 (class 2606 OID 90392)
-- Dependencies: 7482 329 675 8870
-- Name: fiscal_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfiscaldespachoversion
    ADD CONSTRAINT fiscal_fk FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 7995 (class 2606 OID 90397)
-- Dependencies: 7509 375 333 8870
-- Name: fk_accesobloque_bloque; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY accesobloque
    ADD CONSTRAINT fk_accesobloque_bloque FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 7994 (class 2606 OID 90402)
-- Dependencies: 7482 329 333 8870
-- Name: fk_accesobloque_usuario; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY accesobloque
    ADD CONSTRAINT fk_accesobloque_usuario FOREIGN KEY (login) REFERENCES usuario(login);


--
-- TOC entry 8076 (class 2606 OID 90407)
-- Dependencies: 7503 368 410 8870
-- Name: fk_denunciaadicional_autoridad; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY denunciaadicional
    ADD CONSTRAINT fk_denunciaadicional_autoridad FOREIGN KEY (idautoridad) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8089 (class 2606 OID 90412)
-- Dependencies: 7664 588 417 8870
-- Name: fk_desmovilizado_pais; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY desmovilizado
    ADD CONSTRAINT fk_desmovilizado_pais FOREIGN KEY (idpaisdesmovilizacion) REFERENCES pais(idpais);


--
-- TOC entry 8136 (class 2606 OID 90417)
-- Dependencies: 7509 375 475 8870
-- Name: fk_evento_bloque; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_bloque FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8137 (class 2606 OID 90422)
-- Dependencies: 7534 408 475 8870
-- Name: fk_evento_delito; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_delito FOREIGN KEY (delitoprincipal) REFERENCES delito(iddelito);


--
-- TOC entry 8138 (class 2606 OID 90427)
-- Dependencies: 7576 465 475 8870
-- Name: fk_evento_estructura; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_estructura FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8139 (class 2606 OID 90432)
-- Dependencies: 7595 488 475 8870
-- Name: fk_evento_frente; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_frente FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8140 (class 2606 OID 90437)
-- Dependencies: 7597 490 475 8870
-- Name: fk_evento_fuenteinformacion; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_fuenteinformacion FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformacion(idfuenteinformacion);


--
-- TOC entry 8141 (class 2606 OID 90442)
-- Dependencies: 7611 510 475 8870
-- Name: fk_evento_grupoarmado; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT fk_evento_grupoarmado FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8149 (class 2606 OID 90447)
-- Dependencies: 7509 375 488 8870
-- Name: fk_frente_bloque; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY frente
    ADD CONSTRAINT fk_frente_bloque FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8190 (class 2606 OID 90452)
-- Dependencies: 7534 408 516 8870
-- Name: fk_hecho_delito; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT fk_hecho_delito FOREIGN KEY (iddelito) REFERENCES delito(iddelito);


--
-- TOC entry 8191 (class 2606 OID 90457)
-- Dependencies: 7587 475 516 8870
-- Name: fk_hecho_evento; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT fk_hecho_evento FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8328 (class 2606 OID 90462)
-- Dependencies: 7505 370 653 8870
-- Name: fk_relacionbienhecho_bien; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionbienhecho
    ADD CONSTRAINT fk_relacionbienhecho_bien FOREIGN KEY (idbien) REFERENCES bien(idbien);


--
-- TOC entry 8327 (class 2606 OID 90467)
-- Dependencies: 7618 516 653 8870
-- Name: fk_relacionbienhecho_hecho; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionbienhecho
    ADD CONSTRAINT fk_relacionbienhecho_hecho FOREIGN KEY (idhecho) REFERENCES hecho(idhecho);


--
-- TOC entry 8369 (class 2606 OID 90472)
-- Dependencies: 7587 475 679 8870
-- Name: fk_relacionfuentepersona_evento; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuentepersona
    ADD CONSTRAINT fk_relacionfuentepersona_evento FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8368 (class 2606 OID 90477)
-- Dependencies: 7480 328 679 8870
-- Name: fk_relacionfuentepersona_persona; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuentepersona
    ADD CONSTRAINT fk_relacionfuentepersona_persona FOREIGN KEY (idfuente) REFERENCES persona(idpersona);


--
-- TOC entry 8441 (class 2606 OID 90482)
-- Dependencies: 7511 377 729 8870
-- Name: fk_relacionvictimahecho_calidadvictima; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT fk_relacionvictimahecho_calidadvictima FOREIGN KEY (calidadvictima) REFERENCES calidadvictima(idcalidadvictima);


--
-- TOC entry 8442 (class 2606 OID 90487)
-- Dependencies: 7618 516 729 8870
-- Name: fk_relacionvictimahecho_hecho; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT fk_relacionvictimahecho_hecho FOREIGN KEY (idhecho) REFERENCES hecho(idhecho);


--
-- TOC entry 8443 (class 2606 OID 90492)
-- Dependencies: 7480 328 729 8870
-- Name: fk_relacionvictimahecho_persona; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT fk_relacionvictimahecho_persona FOREIGN KEY (idvictima) REFERENCES persona(idpersona);


--
-- TOC entry 8479 (class 2606 OID 90497)
-- Dependencies: 7904 891 792 8870
-- Name: fk_tipocara_rel_proce_tipoproc; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocaratula
    ADD CONSTRAINT fk_tipocara_rel_proce_tipoproc FOREIGN KEY (idtipoprocesojyp) REFERENCES tipoprocesojyp(idtipoprocesojyp) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 8305 (class 2606 OID 90502)
-- Dependencies: 7593 485 640 8870
-- Name: foto_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionalbumfotograficofoto
    ADD CONSTRAINT foto_fk FOREIGN KEY (idfoto) REFERENCES fotos(idfoto);


--
-- TOC entry 8147 (class 2606 OID 90507)
-- Dependencies: 7482 329 485 8870
-- Name: fotosfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fotos
    ADD CONSTRAINT fotosfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7976 (class 2606 OID 90512)
-- Dependencies: 7595 488 331 8870
-- Name: frente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT frente_fk FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8018 (class 2606 OID 90517)
-- Dependencies: 7595 488 346 8870
-- Name: frente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT frente_fk FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8150 (class 2606 OID 90522)
-- Dependencies: 7482 329 490 8870
-- Name: fuenteinformacionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformacion
    ADD CONSTRAINT fuenteinformacionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8151 (class 2606 OID 90527)
-- Dependencies: 7482 329 492 8870
-- Name: funcionario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT funcionario_fk FOREIGN KEY (funcionario) REFERENCES usuario(login) MATCH FULL;


--
-- TOC entry 8161 (class 2606 OID 90532)
-- Dependencies: 7482 329 497 8870
-- Name: funcionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY funcion
    ADD CONSTRAINT funcionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7931 (class 2606 OID 90540)
-- Dependencies: 7603 499 328 8870
-- Name: generofk5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT generofk5 FOREIGN KEY (idgenero) REFERENCES genero(idgenero);


--
-- TOC entry 8162 (class 2606 OID 90545)
-- Dependencies: 7509 375 500 8870
-- Name: genesisgrupoarmado_idbloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idbloque_fkey FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8163 (class 2606 OID 90550)
-- Dependencies: 7538 413 500 8870
-- Name: genesisgrupoarmado_iddepartamento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_iddepartamento_fkey FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8164 (class 2606 OID 90555)
-- Dependencies: 7576 465 500 8870
-- Name: genesisgrupoarmado_idestructura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idestructura_fkey FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8165 (class 2606 OID 90560)
-- Dependencies: 7595 488 500 8870
-- Name: genesisgrupoarmado_idfrente_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idfrente_fkey FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8166 (class 2606 OID 90565)
-- Dependencies: 7611 510 500 8870
-- Name: genesisgrupoarmado_idgrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idgrupoarmado_fkey FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8167 (class 2606 OID 90570)
-- Dependencies: 7646 564 500 8870
-- Name: genesisgrupoarmado_idmunicipio_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idmunicipio_fkey FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8168 (class 2606 OID 90575)
-- Dependencies: 7664 588 500 8870
-- Name: genesisgrupoarmado_idpais_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idpais_fkey FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8169 (class 2606 OID 90580)
-- Dependencies: 7868 838 500 8870
-- Name: genesisgrupoarmado_idtipofecha_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idtipofecha_fkey FOREIGN KEY (idtipofecha) REFERENCES tipofecha(idtipofecha);


--
-- TOC entry 8170 (class 2606 OID 90585)
-- Dependencies: 7870 841 500 8870
-- Name: genesisgrupoarmado_idtipofenomenohistorico_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_idtipofenomenohistorico_fkey FOREIGN KEY (idtipofenomenohistorico) REFERENCES tipofenomenohistorico(idtipofenomenohistorico);


--
-- TOC entry 8171 (class 2606 OID 90590)
-- Dependencies: 7482 329 500 8870
-- Name: genesisgrupoarmado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY genesisgrupoarmado
    ADD CONSTRAINT genesisgrupoarmado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8180 (class 2606 OID 90595)
-- Dependencies: 7509 375 506 8870
-- Name: georeferenciaciongrupoarmado_idbloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idbloque_fkey FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8181 (class 2606 OID 90600)
-- Dependencies: 7538 413 506 8870
-- Name: georeferenciaciongrupoarmado_iddepartamento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_iddepartamento_fkey FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8182 (class 2606 OID 90605)
-- Dependencies: 7576 465 506 8870
-- Name: georeferenciaciongrupoarmado_idestructura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idestructura_fkey FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8183 (class 2606 OID 90610)
-- Dependencies: 7595 488 506 8870
-- Name: georeferenciaciongrupoarmado_idfrente_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idfrente_fkey FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8184 (class 2606 OID 90615)
-- Dependencies: 7611 510 506 8870
-- Name: georeferenciaciongrupoarmado_idgrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idgrupoarmado_fkey FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8185 (class 2606 OID 90620)
-- Dependencies: 7646 564 506 8870
-- Name: georeferenciaciongrupoarmado_idmunicipio_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idmunicipio_fkey FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8186 (class 2606 OID 90625)
-- Dependencies: 7664 588 506 8870
-- Name: georeferenciaciongrupoarmado_idpais_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idpais_fkey FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8187 (class 2606 OID 90630)
-- Dependencies: 7868 838 506 8870
-- Name: georeferenciaciongrupoarmado_idtipofecha_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_idtipofecha_fkey FOREIGN KEY (idtipofecha) REFERENCES tipofecha(idtipofecha);


--
-- TOC entry 8188 (class 2606 OID 90635)
-- Dependencies: 7482 329 506 8870
-- Name: georeferenciaciongrupoarmado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciaciongrupoarmado
    ADD CONSTRAINT georeferenciaciongrupoarmado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7977 (class 2606 OID 90640)
-- Dependencies: 7611 510 331 8870
-- Name: grupoarmado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT grupoarmado_fk FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8019 (class 2606 OID 90645)
-- Dependencies: 7611 510 346 8870
-- Name: grupoarmado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT grupoarmado_fk FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8322 (class 2606 OID 90650)
-- Dependencies: 7618 516 651 8870
-- Name: hecho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT hecho_fk FOREIGN KEY (idhecho) REFERENCES hecho(idhecho);


--
-- TOC entry 8192 (class 2606 OID 90655)
-- Dependencies: 7538 413 516 8870
-- Name: hechodepartamentofk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT hechodepartamentofk3 FOREIGN KEY (departamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8193 (class 2606 OID 90660)
-- Dependencies: 7482 329 516 8870
-- Name: hechofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT hechofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8194 (class 2606 OID 90665)
-- Dependencies: 7646 564 516 8870
-- Name: hechomunicipiofk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT hechomunicipiofk1 FOREIGN KEY (municipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8195 (class 2606 OID 90670)
-- Dependencies: 7664 588 516 8870
-- Name: hechopaisfk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT hechopaisfk2 FOREIGN KEY (pais) REFERENCES pais(idpais);


--
-- TOC entry 8198 (class 2606 OID 90675)
-- Dependencies: 7480 328 520 8870
-- Name: historialfk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8199 (class 2606 OID 90680)
-- Dependencies: 7509 375 520 8870
-- Name: historialfk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk3 FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8200 (class 2606 OID 90685)
-- Dependencies: 7595 488 520 8870
-- Name: historialfk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk4 FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8201 (class 2606 OID 90690)
-- Dependencies: 7692 630 520 8870
-- Name: historialfk5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk5 FOREIGN KEY (idrango) REFERENCES rango(idrango);


--
-- TOC entry 8202 (class 2606 OID 90695)
-- Dependencies: 7798 743 520 8870
-- Name: historialfk6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk6 FOREIGN KEY (idrol) REFERENCES rol(idrol);


--
-- TOC entry 8203 (class 2606 OID 90700)
-- Dependencies: 7589 478 520 8870
-- Name: historialfk8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk8 FOREIGN KEY (idfactoringresoga) REFERENCES factoringresoga(idfactoringresoga);


--
-- TOC entry 8204 (class 2606 OID 90705)
-- Dependencies: 7658 578 520 8870
-- Name: historialfk9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk9 FOREIGN KEY (idorigenevento) REFERENCES origenevento(idorigenevento);


--
-- TOC entry 8205 (class 2606 OID 90710)
-- Dependencies: 7482 329 520 8870
-- Name: historialfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8206 (class 2606 OID 90715)
-- Dependencies: 7576 465 520 8870
-- Name: historialpk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialpersonaga
    ADD CONSTRAINT historialpk2 FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8207 (class 2606 OID 90720)
-- Dependencies: 7538 413 522 8870
-- Name: historialreclusion_iddepartamento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_iddepartamento_fkey FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8208 (class 2606 OID 90725)
-- Dependencies: 7646 564 522 8870
-- Name: historialreclusion_idmunicipio_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_idmunicipio_fkey FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8209 (class 2606 OID 90730)
-- Dependencies: 7664 588 522 8870
-- Name: historialreclusion_idpais_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_idpais_fkey FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8210 (class 2606 OID 90735)
-- Dependencies: 7480 328 522 8870
-- Name: historialreclusion_idpersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_idpersona_fkey FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8211 (class 2606 OID 90740)
-- Dependencies: 7874 848 522 8870
-- Name: historialreclusion_idtipohistorialreclusion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_idtipohistorialreclusion_fkey FOREIGN KEY (idtipohistorialreclusion) REFERENCES tipohistorialreclusion(idtipohistorialreclusion);


--
-- TOC entry 8212 (class 2606 OID 90745)
-- Dependencies: 7482 329 522 8870
-- Name: historialreclusion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialreclusion
    ADD CONSTRAINT historialreclusion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8213 (class 2606 OID 90750)
-- Dependencies: 7538 413 526 8870
-- Name: historialubicaciondepartamentofk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicaciondepartamentofk4 FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8214 (class 2606 OID 90755)
-- Dependencies: 7482 329 526 8870
-- Name: historialubicacionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicacionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8215 (class 2606 OID 90760)
-- Dependencies: 7646 564 526 8870
-- Name: historialubicacionmunicipiofk5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicacionmunicipiofk5 FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8216 (class 2606 OID 90765)
-- Dependencies: 7664 588 526 8870
-- Name: historialubicacionpaisfk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicacionpaisfk3 FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8217 (class 2606 OID 90770)
-- Dependencies: 7480 328 526 8870
-- Name: historialubicacionpersonafk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historialubicacion
    ADD CONSTRAINT historialubicacionpersonafk1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8411 (class 2606 OID 90775)
-- Dependencies: 7490 335 709 8870
-- Name: idacta_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoacta
    ADD CONSTRAINT idacta_fk2 FOREIGN KEY (idacta) REFERENCES acta_asignacion(idacta);


--
-- TOC entry 8152 (class 2606 OID 90780)
-- Dependencies: 7492 340 492 8870
-- Name: idactividadfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idactividadfuenteinformacion_fk FOREIGN KEY (idactividadfuenteinformacion) REFERENCES actividadfuenteinformacion(idactividadfuenteinformacion);


--
-- TOC entry 8153 (class 2606 OID 90785)
-- Dependencies: 7503 368 492 8870
-- Name: idautoridad_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idautoridad_fk FOREIGN KEY (idautoridad) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8067 (class 2606 OID 90790)
-- Dependencies: 7503 368 397 8870
-- Name: idautoridad_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY controlregistrohechos
    ADD CONSTRAINT idautoridad_fk FOREIGN KEY (idautoridad) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8142 (class 2606 OID 90795)
-- Dependencies: 7503 368 475 8870
-- Name: idautoridadfk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT idautoridadfk1 FOREIGN KEY (idautoridadradicado) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8172 (class 2606 OID 90800)
-- Dependencies: 7509 375 504 8870
-- Name: idbloque_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idbloque_fk FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8154 (class 2606 OID 90805)
-- Dependencies: 7515 381 492 8870
-- Name: idcargo_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idcargo_fk FOREIGN KEY (idcargo) REFERENCES cargo(idcargo);


--
-- TOC entry 8404 (class 2606 OID 90810)
-- Dependencies: 7523 391 703 8870
-- Name: idcompulsacion_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonacompulsacion
    ADD CONSTRAINT idcompulsacion_fk2 FOREIGN KEY (idcompulsacion) REFERENCES compulsacion(idcompulsacion);


--
-- TOC entry 8341 (class 2606 OID 90815)
-- Dependencies: 7523 391 661 8870
-- Name: idcompulsacion_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncompulsacionhistoricoprocesal
    ADD CONSTRAINT idcompulsacion_fk2 FOREIGN KEY (idcompulsacion) REFERENCES compulsacion(idcompulsacion);


--
-- TOC entry 8294 (class 2606 OID 90820)
-- Dependencies: 7538 413 635 8870
-- Name: iddepartamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT iddepartamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8530 (class 2606 OID 90825)
-- Dependencies: 7538 413 929 8870
-- Name: iddepartamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT iddepartamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8242 (class 2606 OID 90830)
-- Dependencies: 7538 413 570 8870
-- Name: iddepartamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT iddepartamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8173 (class 2606 OID 90835)
-- Dependencies: 7538 413 504 8870
-- Name: iddepartamento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT iddepartamento_fk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8155 (class 2606 OID 90840)
-- Dependencies: 7538 413 492 8870
-- Name: iddepertamentofuente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT iddepertamentofuente_fk FOREIGN KEY (iddepertamentofuente) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8218 (class 2606 OID 90845)
-- Dependencies: 7544 419 530 8870
-- Name: iddespacho_fk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT iddespacho_fk4 FOREIGN KEY (iddespacho) REFERENCES despacho(iddespacho);


--
-- TOC entry 8344 (class 2606 OID 90850)
-- Dependencies: 7544 419 663 8870
-- Name: iddespachohijo_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondespacho
    ADD CONSTRAINT iddespachohijo_fk FOREIGN KEY (iddespachohijo) REFERENCES despacho(iddespacho);


--
-- TOC entry 8343 (class 2606 OID 90855)
-- Dependencies: 7544 419 663 8870
-- Name: iddespachopadre_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondespacho
    ADD CONSTRAINT iddespachopadre_fk FOREIGN KEY (iddespachopadre) REFERENCES despacho(iddespacho);


--
-- TOC entry 8414 (class 2606 OID 90860)
-- Dependencies: 7558 440 711 8870
-- Name: iddocumentopostulacion_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladodocumentopostulacion
    ADD CONSTRAINT iddocumentopostulacion_fk2 FOREIGN KEY (iddocumentopostulacion) REFERENCES documentopostulacion(iddocumentopostulacion);


--
-- TOC entry 8224 (class 2606 OID 90865)
-- Dependencies: 7509 375 537 8870
-- Name: identificaciongrupoarmado_idbloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_idbloque_fkey FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8225 (class 2606 OID 90870)
-- Dependencies: 7576 465 537 8870
-- Name: identificaciongrupoarmado_idestructura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_idestructura_fkey FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8226 (class 2606 OID 90875)
-- Dependencies: 7595 488 537 8870
-- Name: identificaciongrupoarmado_idfrente_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_idfrente_fkey FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8227 (class 2606 OID 90880)
-- Dependencies: 7611 510 537 8870
-- Name: identificaciongrupoarmado_idgrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_idgrupoarmado_fkey FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8228 (class 2606 OID 90885)
-- Dependencies: 7876 851 537 8870
-- Name: identificaciongrupoarmado_idtipoidentificaciongrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_idtipoidentificaciongrupoarmado_fkey FOREIGN KEY (idtipoidentificaciongrupoarmado) REFERENCES tipoidentificaciongrupoarmado(idtipoidentificaciongrupoarmado);


--
-- TOC entry 8229 (class 2606 OID 90890)
-- Dependencies: 7482 329 537 8870
-- Name: identificaciongrupoarmado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificaciongrupoarmado
    ADD CONSTRAINT identificaciongrupoarmado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8219 (class 2606 OID 90895)
-- Dependencies: 7570 455 530 8870
-- Name: idestadohistoricoprocesal_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT idestadohistoricoprocesal_fk3 FOREIGN KEY (idestadohistoricoprocesal) REFERENCES estadohistoricoprocesal(idestadohistoricoprocesal);


--
-- TOC entry 8174 (class 2606 OID 90900)
-- Dependencies: 7576 465 504 8870
-- Name: idestructura_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idestructura_fk FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8220 (class 2606 OID 90905)
-- Dependencies: 7580 469 530 8870
-- Name: idetapahistoricoprocesal_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT idetapahistoricoprocesal_fk2 FOREIGN KEY (idetapahistoricoprocesal) REFERENCES etapahistoricoprocesal(idetapahistoricoprocesal);


--
-- TOC entry 8295 (class 2606 OID 90910)
-- Dependencies: 7587 475 635 8870
-- Name: idevento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT idevento_fk FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8360 (class 2606 OID 90915)
-- Dependencies: 7587 475 673 8870
-- Name: idevento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventomodusoperandi
    ADD CONSTRAINT idevento_fk FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8357 (class 2606 OID 90920)
-- Dependencies: 7587 475 671 8870
-- Name: idevento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventofuenteinfo
    ADD CONSTRAINT idevento_fk FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8221 (class 2606 OID 90925)
-- Dependencies: 7587 475 530 8870
-- Name: idevento_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT idevento_fk1 FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8062 (class 2606 OID 90930)
-- Dependencies: 7587 475 391 8870
-- Name: idevento_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY compulsacion
    ADD CONSTRAINT idevento_fk1 FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8175 (class 2606 OID 90935)
-- Dependencies: 7595 488 504 8870
-- Name: idfrente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idfrente_fk FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8296 (class 2606 OID 90940)
-- Dependencies: 7597 490 635 8870
-- Name: idfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT idfuenteinformacion_fk FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformacion(idfuenteinformacion);


--
-- TOC entry 8356 (class 2606 OID 90945)
-- Dependencies: 7599 492 671 8870
-- Name: idfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventofuenteinfo
    ADD CONSTRAINT idfuenteinformacion_fk FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8387 (class 2606 OID 90950)
-- Dependencies: 7599 492 691 8870
-- Name: idfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionhistoricoprocesalfuenteinfo
    ADD CONSTRAINT idfuenteinformacion_fk FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8176 (class 2606 OID 90955)
-- Dependencies: 7611 510 504 8870
-- Name: idgrupoarmado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idgrupoarmado_fk FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 7932 (class 2606 OID 90960)
-- Dependencies: 7613 511 328 8870
-- Name: idgrupos_etniocos_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT idgrupos_etniocos_fk FOREIGN KEY (idgrupos_etnicos) REFERENCES grupos_etnicos(idgrupos_etnicos) MATCH FULL;


--
-- TOC entry 8386 (class 2606 OID 90965)
-- Dependencies: 7626 530 691 8870
-- Name: idhistoricoprocesal_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionhistoricoprocesalfuenteinfo
    ADD CONSTRAINT idhistoricoprocesal_fk FOREIGN KEY (idhistoricoprocesal) REFERENCES historicoprocesal(idhistoricoprocesal);


--
-- TOC entry 8340 (class 2606 OID 90970)
-- Dependencies: 7626 530 661 8870
-- Name: idhistoricoprocesal_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncompulsacionhistoricoprocesal
    ADD CONSTRAINT idhistoricoprocesal_fk1 FOREIGN KEY (idhistoricoprocesal) REFERENCES historicoprocesal(idhistoricoprocesal);


--
-- TOC entry 8015 (class 2606 OID 90975)
-- Dependencies: 7626 530 343 8870
-- Name: idhistoricoprocesal_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actuacionhistoricoprocesal
    ADD CONSTRAINT idhistoricoprocesal_fk1 FOREIGN KEY (idhistoricoprocesal) REFERENCES historicoprocesal(idhistoricoprocesal);


--
-- TOC entry 7933 (class 2606 OID 90980)
-- Dependencies: 7628 534 328 8870
-- Name: ididentificacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT ididentificacion_fk FOREIGN KEY (ididentificacion) REFERENCES identificacion(ididentificacion) MATCH FULL;


--
-- TOC entry 8359 (class 2606 OID 90985)
-- Dependencies: 7640 554 673 8870
-- Name: idmodusoperandi_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventomodusoperandi
    ADD CONSTRAINT idmodusoperandi_fk FOREIGN KEY (idmodusoperandi) REFERENCES modusoperandi(idmodusoperandi);


--
-- TOC entry 8196 (class 2606 OID 90990)
-- Dependencies: 7644 560 516 8870
-- Name: idmovil_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT idmovil_fk FOREIGN KEY (idmovil) REFERENCES movil(idmovil);


--
-- TOC entry 8297 (class 2606 OID 90995)
-- Dependencies: 7646 564 635 8870
-- Name: idmunicipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT idmunicipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8531 (class 2606 OID 91000)
-- Dependencies: 7646 564 929 8870
-- Name: idmunicipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT idmunicipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8243 (class 2606 OID 91005)
-- Dependencies: 7646 564 570 8870
-- Name: idmunicipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT idmunicipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8177 (class 2606 OID 91010)
-- Dependencies: 7646 564 504 8870
-- Name: idmunicipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idmunicipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8156 (class 2606 OID 91015)
-- Dependencies: 7646 564 492 8870
-- Name: idmunicipiofuente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idmunicipiofuente_fk FOREIGN KEY (idmunicipiofuente) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7961 (class 2606 OID 91020)
-- Dependencies: 7646 564 329 8870
-- Name: idmunicipiolabor_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT idmunicipiolabor_fk FOREIGN KEY (idmunicipiolabor) REFERENCES municipio(idmunicipio) MATCH FULL;


--
-- TOC entry 8157 (class 2606 OID 91025)
-- Dependencies: 7646 564 492 8870
-- Name: idmunicipiolabor_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idmunicipiolabor_fk FOREIGN KEY (idmunicipiolabor) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8399 (class 2606 OID 91030)
-- Dependencies: 7654 573 699 8870
-- Name: idnotificacioncorreo_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionnotificacioncorreopostulado
    ADD CONSTRAINT idnotificacioncorreo_fk2 FOREIGN KEY (idnotificacioncorreo) REFERENCES notificacioncorreo(idnotificacioncorreo);


--
-- TOC entry 8158 (class 2606 OID 91035)
-- Dependencies: 7660 581 492 8870
-- Name: idorigenfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idorigenfuenteinformacion_fk FOREIGN KEY (idorigenfuenteinformacion) REFERENCES origenfuenteinformacion(idorigenfuenteinformacion);


--
-- TOC entry 8298 (class 2606 OID 91040)
-- Dependencies: 7664 588 635 8870
-- Name: idpais_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT idpais_fk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8532 (class 2606 OID 91045)
-- Dependencies: 7664 588 929 8870
-- Name: idpais_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT idpais_fk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8244 (class 2606 OID 91050)
-- Dependencies: 7664 588 570 8870
-- Name: idpais_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT idpais_fk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8178 (class 2606 OID 91055)
-- Dependencies: 7664 588 504 8870
-- Name: idpais_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT idpais_fk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8159 (class 2606 OID 91060)
-- Dependencies: 7664 588 492 8870
-- Name: idpaisfuente_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT idpaisfuente_fk FOREIGN KEY (idpaisfuente) REFERENCES pais(idpais);


--
-- TOC entry 8240 (class 2606 OID 91065)
-- Dependencies: 7664 588 564 8870
-- Name: idpaispk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY municipio
    ADD CONSTRAINT idpaispk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 7934 (class 2606 OID 91070)
-- Dependencies: 7666 589 328 8870
-- Name: idpartido_politico_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT idpartido_politico_fk FOREIGN KEY (idpartido_politico) REFERENCES partidos_politicos(idpartidos_politicos) MATCH FULL;


--
-- TOC entry 8533 (class 2606 OID 91075)
-- Dependencies: 7480 328 929 8870
-- Name: idpersona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT idpersona_fk FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8245 (class 2606 OID 91080)
-- Dependencies: 7480 328 570 8870
-- Name: idpersona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT idpersona_fk FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8403 (class 2606 OID 91085)
-- Dependencies: 7480 328 703 8870
-- Name: idpersona_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonacompulsacion
    ADD CONSTRAINT idpersona_fk1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 7935 (class 2606 OID 91090)
-- Dependencies: 7694 631 328 8870
-- Name: idraza_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT idraza_fk FOREIGN KEY (idraza) REFERENCES raza(idraza) MATCH FULL;


--
-- TOC entry 8066 (class 2606 OID 91095)
-- Dependencies: 7698 635 397 8870
-- Name: idregistrohechos_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY controlregistrohechos
    ADD CONSTRAINT idregistrohechos_fk FOREIGN KEY (idregistrohecho) REFERENCES registrohecho(idregistrohecho);


--
-- TOC entry 7936 (class 2606 OID 91100)
-- Dependencies: 7790 731 328 8870
-- Name: idreligion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT idreligion_fk FOREIGN KEY (idreligion) REFERENCES religion(idreligion) MATCH FULL;


--
-- TOC entry 8014 (class 2606 OID 91105)
-- Dependencies: 7822 772 343 8870
-- Name: idtipoactuacionhistoricoprocesal_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actuacionhistoricoprocesal
    ADD CONSTRAINT idtipoactuacionhistoricoprocesal_fk2 FOREIGN KEY (idtipoactuacionhistoricoprocesal) REFERENCES tipoactuacionhistoricoprocesal(idtipoactuacionhistoricoprocesal);


--
-- TOC entry 8121 (class 2606 OID 91110)
-- Dependencies: 7834 790 448 8870
-- Name: idtipobien_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY elemento
    ADD CONSTRAINT idtipobien_fk FOREIGN KEY (idtipobien) REFERENCES tipobien(idtipobien);


--
-- TOC entry 8061 (class 2606 OID 91115)
-- Dependencies: 7840 798 391 8870
-- Name: idtipocompulsacion_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY compulsacion
    ADD CONSTRAINT idtipocompulsacion_fk2 FOREIGN KEY (idtipocompulsacion) REFERENCES tipocompulsacion(idtipocompulsacion);


--
-- TOC entry 8103 (class 2606 OID 91120)
-- Dependencies: 7848 809 425 8870
-- Name: idtipodocumentocarpeta_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocarpeta
    ADD CONSTRAINT idtipodocumentocarpeta_fk1 FOREIGN KEY (idtipodocumentocarpeta) REFERENCES tipodocumentocarpeta(idtipodocumentocarpeta);


--
-- TOC entry 8118 (class 2606 OID 91125)
-- Dependencies: 7858 825 440 8870
-- Name: idtipodocumentopostulacion_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopostulacion
    ADD CONSTRAINT idtipodocumentopostulacion_fk1 FOREIGN KEY (idtipodocumentopostulacion) REFERENCES tipodocumentopostulacion(idtipodocumentopostulacion);


--
-- TOC entry 8250 (class 2606 OID 91130)
-- Dependencies: 7864 833 573 8870
-- Name: idtipoestadonotificacioncorreo_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacioncorreo
    ADD CONSTRAINT idtipoestadonotificacioncorreo_fk1 FOREIGN KEY (idtipoestadonotificacioncorreo) REFERENCES tipoestadonotificacioncorreo(idtipoestadonotificacioncorreo);


--
-- TOC entry 8128 (class 2606 OID 91135)
-- Dependencies: 7882 859 469 8870
-- Name: idtipoley_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapahistoricoprocesal
    ADD CONSTRAINT idtipoley_fk FOREIGN KEY (idtipoley) REFERENCES tipoley(idtipoley);


--
-- TOC entry 8473 (class 2606 OID 91140)
-- Dependencies: 7882 859 772 8870
-- Name: idtipoley_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactuacionhistoricoprocesal
    ADD CONSTRAINT idtipoley_fk1 FOREIGN KEY (idtipoley) REFERENCES tipoley(idtipoley);


--
-- TOC entry 8253 (class 2606 OID 91145)
-- Dependencies: 7890 871 581 8870
-- Name: idtipoorigenfuenteinformacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenfuenteinformacion
    ADD CONSTRAINT idtipoorigenfuenteinformacion_fk FOREIGN KEY (idtipoorigenfuenteinformacion) REFERENCES tipoorigenfuenteinformacion(idtipoorigenfuenteinformacion);


--
-- TOC entry 7978 (class 2606 OID 91150)
-- Dependencies: 7900 885 331 8870
-- Name: idtipopostulado; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT idtipopostulado FOREIGN KEY (idtipopostulado) REFERENCES tipopostulado(idtipopostulado);


--
-- TOC entry 8231 (class 2606 OID 91155)
-- Dependencies: 7499 364 540 8870
-- Name: jornadaaudiencia_audiencia_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY jornadaaudiencia
    ADD CONSTRAINT jornadaaudiencia_audiencia_fkey FOREIGN KEY (idaudiencia) REFERENCES audiencia(idaudiencia);


--
-- TOC entry 8232 (class 2606 OID 91160)
-- Dependencies: 7834 790 543 8870
-- Name: listacaracteristicafk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY listacaracteristica
    ADD CONSTRAINT listacaracteristicafk_1 FOREIGN KEY (idtipobien) REFERENCES tipobien(idtipobien);


--
-- TOC entry 7930 (class 2606 OID 91165)
-- Dependencies: 7482 329 326 8870
-- Name: magistrado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY magistrado
    ADD CONSTRAINT magistrado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8234 (class 2606 OID 91170)
-- Dependencies: 7884 862 548 8870
-- Name: mediopublicacion_idtipomediopublicacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY mediopublicacion
    ADD CONSTRAINT mediopublicacion_idtipomediopublicacion_fkey FOREIGN KEY (idtipomediopublicacion) REFERENCES tipomediopublicacion(idtipomediopublicacion);


--
-- TOC entry 8233 (class 2606 OID 91175)
-- Dependencies: 7482 329 548 8870
-- Name: mediopublicacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY mediopublicacion
    ADD CONSTRAINT mediopublicacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8235 (class 2606 OID 91180)
-- Dependencies: 7482 329 552 8870
-- Name: menufk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY menu
    ADD CONSTRAINT menufk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8237 (class 2606 OID 91185)
-- Dependencies: 7482 329 557 8870
-- Name: motivoterminacionetapapostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY motivoterminacionetapapostulado
    ADD CONSTRAINT motivoterminacionetapapostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8455 (class 2606 OID 91190)
-- Dependencies: 7646 564 747 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY salaversion
    ADD CONSTRAINT municipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8548 (class 2606 OID 91195)
-- Dependencies: 7646 564 940 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY version
    ADD CONSTRAINT municipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8056 (class 2606 OID 91200)
-- Dependencies: 7646 564 382 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT municipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8094 (class 2606 OID 91205)
-- Dependencies: 7646 564 419 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY despacho
    ADD CONSTRAINT municipio_fk FOREIGN KEY (municipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8097 (class 2606 OID 91210)
-- Dependencies: 7646 564 422 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT municipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8112 (class 2606 OID 91215)
-- Dependencies: 7646 564 437 8870
-- Name: municipio_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT municipio_fk FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8143 (class 2606 OID 91220)
-- Dependencies: 7646 564 475 8870
-- Name: municipioevntofk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT municipioevntofk4 FOREIGN KEY (municipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8239 (class 2606 OID 91225)
-- Dependencies: 7538 413 564 8870
-- Name: municipiofk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY municipio
    ADD CONSTRAINT municipiofk FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7979 (class 2606 OID 91230)
-- Dependencies: 7648 565 331 8870
-- Name: nivelseguridad_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT nivelseguridad_fk FOREIGN KEY (idnivelseguridad) REFERENCES nivel(idnivel);


--
-- TOC entry 8246 (class 2606 OID 91235)
-- Dependencies: 7484 330 570 8870
-- Name: notificacion_idpersonajuridicacolectividad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT notificacion_idpersonajuridicacolectividad_fkey FOREIGN KEY (idpersonajuridicacolectividad) REFERENCES personajuridicacolectividad(idpersonajuridicacolectividad);


--
-- TOC entry 8247 (class 2606 OID 91240)
-- Dependencies: 7924 920 570 8870
-- Name: notificacion_idtipoubicacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT notificacion_idtipoubicacion_fkey FOREIGN KEY (idtipoubicacion) REFERENCES tipoubicacion(idtipoubicacion);


--
-- TOC entry 8248 (class 2606 OID 91245)
-- Dependencies: 7482 329 570 8870
-- Name: notificacionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacion
    ADD CONSTRAINT notificacionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8057 (class 2606 OID 91250)
-- Dependencies: 7658 578 382 8870
-- Name: origencarpeta_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT origencarpeta_fk FOREIGN KEY (idorigencarpeta) REFERENCES origenevento(idorigenevento);


--
-- TOC entry 8144 (class 2606 OID 91255)
-- Dependencies: 7658 578 475 8870
-- Name: origenevento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT origenevento_fk FOREIGN KEY (idorigenevento) REFERENCES origenevento(idorigenevento);


--
-- TOC entry 8496 (class 2606 OID 91260)
-- Dependencies: 7662 584 845 8870
-- Name: origenhechoversion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohechoversion
    ADD CONSTRAINT origenhechoversion_fk FOREIGN KEY (idorigenhechoversion) REFERENCES origenhechoversion(idorigenhechoversion);


--
-- TOC entry 8113 (class 2606 OID 91265)
-- Dependencies: 7664 588 437 8870
-- Name: pais_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT pais_fk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8098 (class 2606 OID 91270)
-- Dependencies: 7664 588 422 8870
-- Name: pais_pk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT pais_pk FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 7937 (class 2606 OID 91275)
-- Dependencies: 7866 836 328 8870
-- Name: persona_estado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT persona_estado_fkey FOREIGN KEY (estado) REFERENCES tipoestadopersona(idtipoestadopersona);


--
-- TOC entry 8323 (class 2606 OID 91280)
-- Dependencies: 7480 328 651 8870
-- Name: persona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT persona_fk FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8114 (class 2606 OID 91285)
-- Dependencies: 7480 328 437 8870
-- Name: persona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT persona_fk FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 7938 (class 2606 OID 91290)
-- Dependencies: 7593 485 328 8870
-- Name: persona_foto_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT persona_foto_fkey FOREIGN KEY (foto) REFERENCES fotos(idfoto);


--
-- TOC entry 7939 (class 2606 OID 91295)
-- Dependencies: 7814 760 328 8870
-- Name: persona_idtendenciasexual_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT persona_idtendenciasexual_fkey FOREIGN KEY (idtendenciasexual) REFERENCES tendenciasexual(idtendenciasexual);


--
-- TOC entry 7940 (class 2606 OID 91300)
-- Dependencies: 7844 803 328 8870
-- Name: persona_idtipodiscapacidad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT persona_idtipodiscapacidad_fkey FOREIGN KEY (idtipodiscapacidad) REFERENCES tipodiscapacidad(idtipodiscapacidad);


--
-- TOC entry 8256 (class 2606 OID 91305)
-- Dependencies: 7538 413 595 8870
-- Name: personacambiodeidentidad_iddepartamentodocumento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_iddepartamentodocumento_fkey FOREIGN KEY (iddepartamentodocumento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8257 (class 2606 OID 91310)
-- Dependencies: 7556 437 595 8870
-- Name: personacambiodeidentidad_iddocumentopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_iddocumentopersona_fkey FOREIGN KEY (iddocumentopersona) REFERENCES documentopersona(iddocumentopersona);


--
-- TOC entry 8258 (class 2606 OID 91315)
-- Dependencies: 7646 564 595 8870
-- Name: personacambiodeidentidad_idmunicipiodocumento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_idmunicipiodocumento_fkey FOREIGN KEY (idmunicipiodocumento) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8259 (class 2606 OID 91320)
-- Dependencies: 7664 588 595 8870
-- Name: personacambiodeidentidad_idpaisdocumento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_idpaisdocumento_fkey FOREIGN KEY (idpaisdocumento) REFERENCES pais(idpais);


--
-- TOC entry 8260 (class 2606 OID 91325)
-- Dependencies: 7480 328 595 8870
-- Name: personacambiodeidentidad_idpersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_idpersona_fkey FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8261 (class 2606 OID 91330)
-- Dependencies: 7854 820 595 8870
-- Name: personacambiodeidentidad_idtipodocumentoidentidad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_idtipodocumentoidentidad_fkey FOREIGN KEY (idtipodocumentoidentidad) REFERENCES tipodocumentoidentidad(idtipodocumentoidentidad);


--
-- TOC entry 8262 (class 2606 OID 91335)
-- Dependencies: 7482 329 595 8870
-- Name: personacambiodeidentidad_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personacambiodeidentidad
    ADD CONSTRAINT personacambiodeidentidad_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8266 (class 2606 OID 91340)
-- Dependencies: 7480 328 598 8870
-- Name: personaestadohistorico_idpersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadohistorico
    ADD CONSTRAINT personaestadohistorico_idpersona_fkey FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8265 (class 2606 OID 91345)
-- Dependencies: 7484 330 598 8870
-- Name: personaestadohistorico_idpersonajuridicacolectividad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadohistorico
    ADD CONSTRAINT personaestadohistorico_idpersonajuridicacolectividad_fkey FOREIGN KEY (idpersonajuridicacolectividad) REFERENCES personajuridicacolectividad(idpersonajuridicacolectividad);


--
-- TOC entry 8264 (class 2606 OID 91350)
-- Dependencies: 7866 836 598 8870
-- Name: personaestadohistorico_idtipoestadopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadohistorico
    ADD CONSTRAINT personaestadohistorico_idtipoestadopersona_fkey FOREIGN KEY (idtipoestadopersona) REFERENCES tipoestadopersona(idtipoestadopersona);


--
-- TOC entry 8263 (class 2606 OID 91355)
-- Dependencies: 7482 329 598 8870
-- Name: personaestadohistorico_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadohistorico
    ADD CONSTRAINT personaestadohistorico_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8267 (class 2606 OID 91360)
-- Dependencies: 7480 328 601 8870
-- Name: personaestadosocioeconomico_idpersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_idpersona_fkey FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8268 (class 2606 OID 91365)
-- Dependencies: 7818 766 601 8870
-- Name: personaestadosocioeconomico_idtipoaccesosalud_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_idtipoaccesosalud_fkey FOREIGN KEY (idtipoaccesosalud) REFERENCES tipoaccesosalud(idtipoaccesosalud);


--
-- TOC entry 8269 (class 2606 OID 91370)
-- Dependencies: 7886 865 601 8870
-- Name: personaestadosocioeconomico_idtipomoneda_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_idtipomoneda_fkey FOREIGN KEY (idtipomoneda) REFERENCES tipomoneda(idtipomoneda);


--
-- TOC entry 8270 (class 2606 OID 91375)
-- Dependencies: 7888 868 601 8870
-- Name: personaestadosocioeconomico_idtiponivelsisben_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_idtiponivelsisben_fkey FOREIGN KEY (idtiponivelsisben) REFERENCES tiponivelsisben(idtiponivelsisben);


--
-- TOC entry 8271 (class 2606 OID 91380)
-- Dependencies: 7914 905 601 8870
-- Name: personaestadosocioeconomico_idtiposectortrabajo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_idtiposectortrabajo_fkey FOREIGN KEY (idtiposectortrabajo) REFERENCES tiposectortrabajo(idtiposectortrabajo);


--
-- TOC entry 8272 (class 2606 OID 91385)
-- Dependencies: 7482 329 601 8870
-- Name: personaestadosocioeconomico_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personaestadosocioeconomico
    ADD CONSTRAINT personaestadosocioeconomico_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7941 (class 2606 OID 91390)
-- Dependencies: 7898 884 328 8870
-- Name: personafk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk1 FOREIGN KEY (idtipopersona) REFERENCES tipopersona(idtipopersona);


--
-- TOC entry 7942 (class 2606 OID 91395)
-- Dependencies: 7684 619 328 8870
-- Name: personafk10; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk10 FOREIGN KEY (idprofesion) REFERENCES profesion(idprofesion);


--
-- TOC entry 7943 (class 2606 OID 91400)
-- Dependencies: 7538 413 328 8870
-- Name: personafk11; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk11 FOREIGN KEY (iddepartamentodocumentodeidentidad) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7944 (class 2606 OID 91405)
-- Dependencies: 7597 490 328 8870
-- Name: personafk12; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk12 FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformacion(idfuenteinformacion);


--
-- TOC entry 7945 (class 2606 OID 91410)
-- Dependencies: 7538 413 328 8870
-- Name: personafk13; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk13 FOREIGN KEY (iddepartamentonacimineto) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7946 (class 2606 OID 91415)
-- Dependencies: 7646 564 328 8870
-- Name: personafk14; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk14 FOREIGN KEY (idmunicipiodocumentodeidentidad) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7947 (class 2606 OID 91420)
-- Dependencies: 7615 515 328 8870
-- Name: personafk15; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk15 FOREIGN KEY (idgruposanguineo) REFERENCES gruposanguineo(idgruposanguineo);


--
-- TOC entry 7948 (class 2606 OID 91425)
-- Dependencies: 7664 588 328 8870
-- Name: personafk16; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk16 FOREIGN KEY (idpaisdireccion) REFERENCES pais(idpais);


--
-- TOC entry 7949 (class 2606 OID 91430)
-- Dependencies: 7538 413 328 8870
-- Name: personafk17; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk17 FOREIGN KEY (iddepartamentodireccion) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7950 (class 2606 OID 91435)
-- Dependencies: 7646 564 328 8870
-- Name: personafk18; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk18 FOREIGN KEY (idmunicipiodireccion) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7951 (class 2606 OID 91440)
-- Dependencies: 7854 820 328 8870
-- Name: personafk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk2 FOREIGN KEY (iddocumentodeidentidad) REFERENCES tipodocumentoidentidad(idtipodocumentoidentidad);


--
-- TOC entry 7952 (class 2606 OID 91445)
-- Dependencies: 7664 588 328 8870
-- Name: personafk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk3 FOREIGN KEY (idpaisdocumentodeidentidad) REFERENCES pais(idpais);


--
-- TOC entry 7953 (class 2606 OID 91450)
-- Dependencies: 7646 564 328 8870
-- Name: personafk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk4 FOREIGN KEY (idmunicipiodocumentodeidentidad) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7954 (class 2606 OID 91455)
-- Dependencies: 7664 588 328 8870
-- Name: personafk6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk6 FOREIGN KEY (idpaisdenacimiento) REFERENCES pais(idpais);


--
-- TOC entry 7955 (class 2606 OID 91460)
-- Dependencies: 7646 564 328 8870
-- Name: personafk7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk7 FOREIGN KEY (idmunicipionacimiento) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7956 (class 2606 OID 91465)
-- Dependencies: 7566 451 328 8870
-- Name: personafk8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk8 FOREIGN KEY (idestadocivil) REFERENCES estadocivil(idestadocivil);


--
-- TOC entry 7957 (class 2606 OID 91470)
-- Dependencies: 7650 569 328 8870
-- Name: personafk9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY persona
    ADD CONSTRAINT personafk9 FOREIGN KEY (idniveleducacion) REFERENCES niveleducacion(idniveleducacion);


--
-- TOC entry 7962 (class 2606 OID 91475)
-- Dependencies: 7538 413 330 8870
-- Name: personajuridicacolectividad_iddepartamentoexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_iddepartamentoexpedicion_fkey FOREIGN KEY (iddepartamentoexpedicion) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7963 (class 2606 OID 91480)
-- Dependencies: 7646 564 330 8870
-- Name: personajuridicacolectividad_idmunicipioexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idmunicipioexpedicion_fkey FOREIGN KEY (idmunicipioexpedicion) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7964 (class 2606 OID 91485)
-- Dependencies: 7664 588 330 8870
-- Name: personajuridicacolectividad_idpaisexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idpaisexpedicion_fkey FOREIGN KEY (idpaisexpedicion) REFERENCES pais(idpais);


--
-- TOC entry 7965 (class 2606 OID 91490)
-- Dependencies: 7838 795 330 8870
-- Name: personajuridicacolectividad_idtipoclasificacionpersonajuri_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idtipoclasificacionpersonajuri_fkey FOREIGN KEY (idtipoclasificacionpersonajuridica) REFERENCES tipoclasificacionpersonajuridica(idtipoclasificacionpersonajuridica);


--
-- TOC entry 7966 (class 2606 OID 91495)
-- Dependencies: 7854 820 330 8870
-- Name: personajuridicacolectividad_idtipodocumentoidentidad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idtipodocumentoidentidad_fkey FOREIGN KEY (idtipodocumentoidentidad) REFERENCES tipodocumentoidentidad(idtipodocumentoidentidad);


--
-- TOC entry 7967 (class 2606 OID 91500)
-- Dependencies: 7866 836 330 8870
-- Name: personajuridicacolectividad_idtipoestadopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idtipoestadopersona_fkey FOREIGN KEY (idtipoestadopersona) REFERENCES tipoestadopersona(idtipoestadopersona);


--
-- TOC entry 7968 (class 2606 OID 91505)
-- Dependencies: 7898 884 330 8870
-- Name: personajuridicacolectividad_idtipopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idtipopersona_fkey FOREIGN KEY (idtipopersona) REFERENCES tipopersona(idtipopersona);


--
-- TOC entry 7969 (class 2606 OID 91510)
-- Dependencies: 7916 908 330 8870
-- Name: personajuridicacolectividad_idtiposubclasificacionpersonaj_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_idtiposubclasificacionpersonaj_fkey FOREIGN KEY (idtiposubclasificacionpersonajuridica) REFERENCES tiposubclasificacionpersonajuridica(idtiposubclasificacionpersonajuridica);


--
-- TOC entry 7970 (class 2606 OID 91515)
-- Dependencies: 7482 329 330 8870
-- Name: personajuridicacolectividad_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividad
    ADD CONSTRAINT personajuridicacolectividad_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8274 (class 2606 OID 91520)
-- Dependencies: 7484 330 606 8870
-- Name: personajuridicacolectividadco_idpersonajuridicacolectivida_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividadcorreo
    ADD CONSTRAINT personajuridicacolectividadco_idpersonajuridicacolectivida_fkey FOREIGN KEY (idpersonajuridicacolectividad) REFERENCES personajuridicacolectividad(idpersonajuridicacolectividad);


--
-- TOC entry 8273 (class 2606 OID 91525)
-- Dependencies: 7482 329 606 8870
-- Name: personajuridicacolectividadcorreo_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY personajuridicacolectividadcorreo
    ADD CONSTRAINT personajuridicacolectividadcorreo_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7980 (class 2606 OID 91530)
-- Dependencies: 7480 328 331 8870
-- Name: postulado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT postulado_fk FOREIGN KEY (postulado) REFERENCES persona(idpersona);


--
-- TOC entry 7981 (class 2606 OID 91535)
-- Dependencies: 7878 854 331 8870
-- Name: postulado_idtipoinactivopostulado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT postulado_idtipoinactivopostulado_fkey FOREIGN KEY (idtipoinactivopostulado) REFERENCES tipoinactivopostulado(idtipoinactivopostulado);


--
-- TOC entry 7982 (class 2606 OID 91540)
-- Dependencies: 7902 888 331 8870
-- Name: postulado_idtipopreclusionpostulado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT postulado_idtipopreclusionpostulado_fkey FOREIGN KEY (idtipopreclusionpostulado) REFERENCES tipopreclusionpostulado(idtipopreclusionpostulado);


--
-- TOC entry 7983 (class 2606 OID 91545)
-- Dependencies: 7928 940 331 8870
-- Name: postulado_idversionratifica_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT postulado_idversionratifica_fkey FOREIGN KEY (idversionratifica) REFERENCES version(idversion);


--
-- TOC entry 8275 (class 2606 OID 91550)
-- Dependencies: 7503 368 611 8870
-- Name: postuladoasignacion_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8276 (class 2606 OID 91555)
-- Dependencies: 7482 329 611 8870
-- Name: postuladoasignacion_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8277 (class 2606 OID 91560)
-- Dependencies: 7509 375 611 8870
-- Name: postuladoasignacion_idbloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idbloque_fkey FOREIGN KEY (idbloque) REFERENCES bloque(idbloque);


--
-- TOC entry 8278 (class 2606 OID 91565)
-- Dependencies: 7576 465 611 8870
-- Name: postuladoasignacion_idestructura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idestructura_fkey FOREIGN KEY (idestructura) REFERENCES estructura(idestructura);


--
-- TOC entry 8279 (class 2606 OID 91570)
-- Dependencies: 7595 488 611 8870
-- Name: postuladoasignacion_idfrente_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idfrente_fkey FOREIGN KEY (idfrente) REFERENCES frente(idfrente);


--
-- TOC entry 8280 (class 2606 OID 91575)
-- Dependencies: 7611 510 611 8870
-- Name: postuladoasignacion_idgrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idgrupoarmado_fkey FOREIGN KEY (idgrupoarmado) REFERENCES grupoarmado(idgrupoarmado);


--
-- TOC entry 8281 (class 2606 OID 91580)
-- Dependencies: 7796 739 611 8870
-- Name: postuladoasignacion_idresolucionasignacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idresolucionasignacion_fkey FOREIGN KEY (idresolucionasignacion) REFERENCES resolucionasignacion(idresolucionasignacion);


--
-- TOC entry 8282 (class 2606 OID 91585)
-- Dependencies: 7804 750 611 8870
-- Name: postuladoasignacion_idsede_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_idsede_fkey FOREIGN KEY (idsede) REFERENCES sede(idsede);


--
-- TOC entry 8283 (class 2606 OID 91590)
-- Dependencies: 7486 331 611 8870
-- Name: postuladoasignacion_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8284 (class 2606 OID 91595)
-- Dependencies: 7482 329 611 8870
-- Name: postuladoasignacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoasignacion
    ADD CONSTRAINT postuladoasignacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8287 (class 2606 OID 91600)
-- Dependencies: 7587 475 614 8870
-- Name: postuladoeventoaudiencia_idevento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoeventoaudiencia
    ADD CONSTRAINT postuladoeventoaudiencia_idevento_fkey FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8286 (class 2606 OID 91605)
-- Dependencies: 7486 331 614 8870
-- Name: postuladoeventoaudiencia_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoeventoaudiencia
    ADD CONSTRAINT postuladoeventoaudiencia_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8285 (class 2606 OID 91610)
-- Dependencies: 7482 329 614 8870
-- Name: postuladoeventoaudiencia_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postuladoeventoaudiencia
    ADD CONSTRAINT postuladoeventoaudiencia_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8288 (class 2606 OID 91615)
-- Dependencies: 7574 461 620 8870
-- Name: programacionreporte_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY programacionreporte
    ADD CONSTRAINT programacionreporte_fk1 FOREIGN KEY (idestadoprogramacionreporte) REFERENCES estadoprogramacionreporte(idestadoprogramacionreporte);


--
-- TOC entry 8290 (class 2606 OID 91620)
-- Dependencies: 7636 548 623 8870
-- Name: publicacionexterna_idmediopublicacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacionexterna
    ADD CONSTRAINT publicacionexterna_idmediopublicacion_fkey FOREIGN KEY (idmediopublicacion) REFERENCES mediopublicacion(idmediopublicacion);


--
-- TOC entry 8289 (class 2606 OID 91625)
-- Dependencies: 7482 329 623 8870
-- Name: publicacionexterna_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacionexterna
    ADD CONSTRAINT publicacionexterna_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8292 (class 2606 OID 91630)
-- Dependencies: 7636 548 626 8870
-- Name: publicacioninterna_idmediopublicacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacioninterna
    ADD CONSTRAINT publicacioninterna_idmediopublicacion_fkey FOREIGN KEY (idmediopublicacion) REFERENCES mediopublicacion(idmediopublicacion);


--
-- TOC entry 8291 (class 2606 OID 91635)
-- Dependencies: 7482 329 626 8870
-- Name: publicacioninterna_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY publicacioninterna
    ADD CONSTRAINT publicacioninterna_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8417 (class 2606 OID 91640)
-- Dependencies: 7486 331 713 8870
-- Name: radicado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoversion
    ADD CONSTRAINT radicado_fk FOREIGN KEY (radicado) REFERENCES postulado(radicado) ON UPDATE CASCADE;


--
-- TOC entry 8398 (class 2606 OID 91645)
-- Dependencies: 7486 331 699 8870
-- Name: radicado_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionnotificacioncorreopostulado
    ADD CONSTRAINT radicado_fk1 FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8413 (class 2606 OID 91650)
-- Dependencies: 7486 331 711 8870
-- Name: radicado_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladodocumentopostulacion
    ADD CONSTRAINT radicado_fk1 FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8410 (class 2606 OID 91655)
-- Dependencies: 7486 331 709 8870
-- Name: radicado_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoacta
    ADD CONSTRAINT radicado_fk1 FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8425 (class 2606 OID 91660)
-- Dependencies: 7698 635 719 8870
-- Name: registrohecho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionregistrohechodocumento
    ADD CONSTRAINT registrohecho_fk FOREIGN KEY (idregistrohecho) REFERENCES registrohecho(idregistrohecho);


--
-- TOC entry 8299 (class 2606 OID 91665)
-- Dependencies: 7482 329 635 8870
-- Name: registrohechofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT registrohechofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8303 (class 2606 OID 91670)
-- Dependencies: 7494 343 638 8870
-- Name: relacionactuacionhistoricoprocesalpersona_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionactuacionhistoricoprocesalpersona
    ADD CONSTRAINT relacionactuacionhistoricoprocesalpersona_fk1 FOREIGN KEY (idhistoricoprocesaldecision) REFERENCES actuacionhistoricoprocesal(idhistoricoprocesaldecision);


--
-- TOC entry 8302 (class 2606 OID 91675)
-- Dependencies: 7480 328 638 8870
-- Name: relacionactuacionhistoricoprocesalpersona_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionactuacionhistoricoprocesalpersona
    ADD CONSTRAINT relacionactuacionhistoricoprocesalpersona_fk2 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8307 (class 2606 OID 91680)
-- Dependencies: 7517 382 642 8870
-- Name: relacionaudienciacarpeta_idcarpetahecho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_idcarpetahecho_fkey FOREIGN KEY (idcarpetahecho) REFERENCES carpetahecho(idcarpetahecho);


--
-- TOC entry 8308 (class 2606 OID 91685)
-- Dependencies: 7582 472 642 8870
-- Name: relacionaudienciacarpeta_idetapaprocesoretorno_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_idetapaprocesoretorno_fkey FOREIGN KEY (idetapaprocesoretorno) REFERENCES etapaproceso(idetapaproceso);


--
-- TOC entry 8309 (class 2606 OID 91690)
-- Dependencies: 7587 475 642 8870
-- Name: relacionaudienciacarpeta_idevento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_idevento_fkey FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8310 (class 2606 OID 91695)
-- Dependencies: 7632 540 642 8870
-- Name: relacionaudienciacarpeta_idjornadaaudiencia_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_idjornadaaudiencia_fkey FOREIGN KEY (idjornadaaudiencia) REFERENCES jornadaaudiencia(idjornadaaudiencia);


--
-- TOC entry 8311 (class 2606 OID 91700)
-- Dependencies: 7482 329 642 8870
-- Name: relacionaudienciacarpeta_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciacarpeta
    ADD CONSTRAINT relacionaudienciacarpeta_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8315 (class 2606 OID 91705)
-- Dependencies: 7503 368 645 8870
-- Name: relacionaudienciafiscal_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciafiscal
    ADD CONSTRAINT relacionaudienciafiscal_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8314 (class 2606 OID 91710)
-- Dependencies: 7482 329 645 8870
-- Name: relacionaudienciafiscal_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciafiscal
    ADD CONSTRAINT relacionaudienciafiscal_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8313 (class 2606 OID 91715)
-- Dependencies: 7499 364 645 8870
-- Name: relacionaudienciafiscal_idaudiencia_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciafiscal
    ADD CONSTRAINT relacionaudienciafiscal_idaudiencia_fkey FOREIGN KEY (idaudiencia) REFERENCES audiencia(idaudiencia);


--
-- TOC entry 8312 (class 2606 OID 91720)
-- Dependencies: 7482 329 645 8870
-- Name: relacionaudienciafiscal_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciafiscal
    ADD CONSTRAINT relacionaudienciafiscal_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8317 (class 2606 OID 91725)
-- Dependencies: 7486 331 647 8870
-- Name: relacionaudienciaradicado_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciaradicado
    ADD CONSTRAINT relacionaudienciaradicado_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8316 (class 2606 OID 91730)
-- Dependencies: 7482 329 647 8870
-- Name: relacionaudienciaradicado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionaudienciaradicado
    ADD CONSTRAINT relacionaudienciaradicado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8320 (class 2606 OID 91735)
-- Dependencies: 7482 329 649 8870
-- Name: relacionautoreventofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorevento
    ADD CONSTRAINT relacionautoreventofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8326 (class 2606 OID 91740)
-- Dependencies: 7482 329 653 8870
-- Name: relacionbienhecho_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionbienhecho
    ADD CONSTRAINT relacionbienhecho_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8335 (class 2606 OID 91745)
-- Dependencies: 7532 404 657 8870
-- Name: relacioncausadecisionterminacionproc_iddecisionterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausadecisionterminacionprocesopostulado
    ADD CONSTRAINT relacioncausadecisionterminacionproc_iddecisionterminacion_fkey FOREIGN KEY (iddecisionterminacion) REFERENCES decisionterminacionprocesopostulado(iddecisionterminacion);


--
-- TOC entry 8334 (class 2606 OID 91750)
-- Dependencies: 7519 385 657 8870
-- Name: relacioncausadecisionterminacionproceso_idcausaterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausadecisionterminacionprocesopostulado
    ADD CONSTRAINT relacioncausadecisionterminacionproceso_idcausaterminacion_fkey FOREIGN KEY (idcausaterminacion) REFERENCES causaterminacionprocesopostulado(idcausaterminacion);


--
-- TOC entry 8333 (class 2606 OID 91755)
-- Dependencies: 7482 329 657 8870
-- Name: relacioncausadecisionterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausadecisionterminacionprocesopostulado
    ADD CONSTRAINT relacioncausadecisionterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8338 (class 2606 OID 91760)
-- Dependencies: 7810 756 659 8870
-- Name: relacioncausaterminacionprocesopost_idsolicitudterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausaterminacionprocesopostulado
    ADD CONSTRAINT relacioncausaterminacionprocesopost_idsolicitudterminacion_fkey FOREIGN KEY (idsolicitudterminacion) REFERENCES solicitudterminacionprocesopostulado(idsolicitudterminacion);


--
-- TOC entry 8337 (class 2606 OID 91765)
-- Dependencies: 7519 385 659 8870
-- Name: relacioncausaterminacionprocesopostulad_idcausaterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausaterminacionprocesopostulado
    ADD CONSTRAINT relacioncausaterminacionprocesopostulad_idcausaterminacion_fkey FOREIGN KEY (idcausaterminacion) REFERENCES causaterminacionprocesopostulado(idcausaterminacion);


--
-- TOC entry 8336 (class 2606 OID 91770)
-- Dependencies: 7482 329 659 8870
-- Name: relacioncausaterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncausaterminacionprocesopostulado
    ADD CONSTRAINT relacioncausaterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8347 (class 2606 OID 91775)
-- Dependencies: 7554 434 665 8870
-- Name: relaciondocumentoedictopostul_iddocumentoedictoemplazatori_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentoedictopostulado
    ADD CONSTRAINT relaciondocumentoedictopostul_iddocumentoedictoemplazatori_fkey FOREIGN KEY (iddocumentoedictoemplazatorio) REFERENCES documentoedictoemplazatorio(iddocumentoedictoemplazatorio);


--
-- TOC entry 8346 (class 2606 OID 91780)
-- Dependencies: 7486 331 665 8870
-- Name: relaciondocumentoedictopostulado_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentoedictopostulado
    ADD CONSTRAINT relaciondocumentoedictopostulado_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8345 (class 2606 OID 91785)
-- Dependencies: 7482 329 665 8870
-- Name: relaciondocumentoedictopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentoedictopostulado
    ADD CONSTRAINT relaciondocumentoedictopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8350 (class 2606 OID 91790)
-- Dependencies: 7560 443 667 8870
-- Name: relaciondocumentospostulacion_iddocumentospostulacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentospostulacion
    ADD CONSTRAINT relaciondocumentospostulacion_iddocumentospostulacion_fkey FOREIGN KEY (iddocumentospostulacion) REFERENCES documentospostulacion(iddocumentospostulacion);


--
-- TOC entry 8349 (class 2606 OID 91795)
-- Dependencies: 7486 331 667 8870
-- Name: relaciondocumentospostulacion_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentospostulacion
    ADD CONSTRAINT relaciondocumentospostulacion_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8348 (class 2606 OID 91800)
-- Dependencies: 7482 329 667 8870
-- Name: relaciondocumentospostulacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondocumentospostulacion
    ADD CONSTRAINT relaciondocumentospostulacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8354 (class 2606 OID 91805)
-- Dependencies: 7587 475 669 8870
-- Name: relacionevento_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionevento
    ADD CONSTRAINT relacionevento_fk1 FOREIGN KEY (idevento1) REFERENCES evento(idevento);


--
-- TOC entry 8353 (class 2606 OID 91810)
-- Dependencies: 7587 475 669 8870
-- Name: relacionevento_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionevento
    ADD CONSTRAINT relacionevento_fk2 FOREIGN KEY (idevento2) REFERENCES evento(idevento);


--
-- TOC entry 8352 (class 2606 OID 91815)
-- Dependencies: 7908 897 669 8870
-- Name: relacionevento_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionevento
    ADD CONSTRAINT relacionevento_fk3 FOREIGN KEY (idtiporelacionevento) REFERENCES tiporelacionevento(idtiporelacionevento);


--
-- TOC entry 8319 (class 2606 OID 91820)
-- Dependencies: 7480 328 649 8870
-- Name: relacioneventopersonafk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorevento
    ADD CONSTRAINT relacioneventopersonafk1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8318 (class 2606 OID 91825)
-- Dependencies: 7587 475 649 8870
-- Name: relacioneventopersonafk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorevento
    ADD CONSTRAINT relacioneventopersonafk2 FOREIGN KEY (idevento) REFERENCES evento(idevento);


--
-- TOC entry 8366 (class 2606 OID 91830)
-- Dependencies: 7599 492 677 8870
-- Name: relacionfuentehistorialpga_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuentehistorialpga
    ADD CONSTRAINT relacionfuentehistorialpga_fk1 FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8365 (class 2606 OID 91835)
-- Dependencies: 7620 520 677 8870
-- Name: relacionfuentehistorialpga_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuentehistorialpga
    ADD CONSTRAINT relacionfuentehistorialpga_fk2 FOREIGN KEY (idhistorial) REFERENCES historialpersonaga(idhistorial);


--
-- TOC entry 8367 (class 2606 OID 91840)
-- Dependencies: 7482 329 679 8870
-- Name: relacionfuentepersonafk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuentepersona
    ADD CONSTRAINT relacionfuentepersonafk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8370 (class 2606 OID 91845)
-- Dependencies: 7482 329 681 8870
-- Name: relacionfuncionperfilfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfuncionperfil
    ADD CONSTRAINT relacionfuncionperfilfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8373 (class 2606 OID 91850)
-- Dependencies: 7605 500 683 8870
-- Name: relaciongenesisgrupoarmadofuenteinformacion_idgenesisgrupoarmad; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongenesisgrupoarmadofuenteinformacion_idgenesisgrupoarmad FOREIGN KEY (idgenesisgrupoarmado) REFERENCES genesisgrupoarmado(idgenesisgrupoarmado);


--
-- TOC entry 8372 (class 2606 OID 91855)
-- Dependencies: 7482 329 683 8870
-- Name: relaciongenesisgrupoarmadofuenteinformacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongenesisgrupoarmadofuenteinformacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8377 (class 2606 OID 91860)
-- Dependencies: 7605 500 685 8870
-- Name: relaciongenesisgrupoarmadoversion_idgenesisgrupoarmado_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadoversion
    ADD CONSTRAINT relaciongenesisgrupoarmadoversion_idgenesisgrupoarmado_fkey1 FOREIGN KEY (idgenesisgrupoarmado) REFERENCES genesisgrupoarmado(idgenesisgrupoarmado);


--
-- TOC entry 8376 (class 2606 OID 91865)
-- Dependencies: 7928 940 685 8870
-- Name: relaciongenesisgrupoarmadoversion_idversion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadoversion
    ADD CONSTRAINT relaciongenesisgrupoarmadoversion_idversion_fkey FOREIGN KEY (idversion) REFERENCES version(idversion);


--
-- TOC entry 8375 (class 2606 OID 91870)
-- Dependencies: 7486 331 685 8870
-- Name: relaciongenesisgrupoarmadoversion_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadoversion
    ADD CONSTRAINT relaciongenesisgrupoarmadoversion_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8374 (class 2606 OID 91875)
-- Dependencies: 7482 329 685 8870
-- Name: relaciongenesisgrupoarmadoversion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadoversion
    ADD CONSTRAINT relaciongenesisgrupoarmadoversion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8380 (class 2606 OID 91880)
-- Dependencies: 7599 492 687 8870
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_idfuentei; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadofuenteinformacion_idfuentei FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8379 (class 2606 OID 91885)
-- Dependencies: 7609 506 687 8870
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_idgeorefe; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadofuenteinformacion_idgeorefe FOREIGN KEY (idgeoreferenciaciongrupoarmado) REFERENCES georeferenciaciongrupoarmado(idgeoreferenciaciongrupoarmado);


--
-- TOC entry 8378 (class 2606 OID 91890)
-- Dependencies: 7482 329 687 8870
-- Name: relaciongeoreferenciaciongrupoarmadofuenteinformacion_usuario_f; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadofuenteinformacion_usuario_f FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8384 (class 2606 OID 91895)
-- Dependencies: 7609 506 689 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_idgeoreferenciacion; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadoversion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadoversion_idgeoreferenciacion FOREIGN KEY (idgeoreferenciaciongrupoarmado) REFERENCES georeferenciaciongrupoarmado(idgeoreferenciaciongrupoarmado);


--
-- TOC entry 8383 (class 2606 OID 91900)
-- Dependencies: 7928 940 689 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_idversion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadoversion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadoversion_idversion_fkey FOREIGN KEY (idversion) REFERENCES version(idversion);


--
-- TOC entry 8382 (class 2606 OID 91905)
-- Dependencies: 7486 331 689 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadoversion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadoversion_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8381 (class 2606 OID 91910)
-- Dependencies: 7482 329 689 8870
-- Name: relaciongeoreferenciaciongrupoarmadoversion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongeoreferenciaciongrupoarmadoversion
    ADD CONSTRAINT relaciongeoreferenciaciongrupoarmadoversion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8394 (class 2606 OID 91915)
-- Dependencies: 7630 537 695 8870
-- Name: relacionidentificaciongrupoar_ididentificaciongrupoarmado_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadoversion
    ADD CONSTRAINT relacionidentificaciongrupoar_ididentificaciongrupoarmado_fkey1 FOREIGN KEY (ididentificaciongrupoarmado) REFERENCES identificaciongrupoarmado(ididentificaciongrupoarmado);


--
-- TOC entry 8390 (class 2606 OID 91920)
-- Dependencies: 7630 537 693 8870
-- Name: relacionidentificaciongrupoarm_ididentificaciongrupoarmado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relacionidentificaciongrupoarm_ididentificaciongrupoarmado_fkey FOREIGN KEY (ididentificaciongrupoarmado) REFERENCES identificaciongrupoarmado(ididentificaciongrupoarmado);


--
-- TOC entry 8389 (class 2606 OID 91925)
-- Dependencies: 7599 492 693 8870
-- Name: relacionidentificaciongrupoarmadofuent_idfuenteinformacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relacionidentificaciongrupoarmadofuent_idfuenteinformacion_fkey FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8371 (class 2606 OID 91930)
-- Dependencies: 7599 492 683 8870
-- Name: relacionidentificaciongrupoarmadofuent_idfuenteinformacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciongenesisgrupoarmadofuenteinformacion
    ADD CONSTRAINT relacionidentificaciongrupoarmadofuent_idfuenteinformacion_fkey FOREIGN KEY (idfuenteinformacion) REFERENCES fuenteinformaciondatos(idfuenteinformacion);


--
-- TOC entry 8388 (class 2606 OID 91935)
-- Dependencies: 7482 329 693 8870
-- Name: relacionidentificaciongrupoarmadofuenteinformacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadofuenteinformacion
    ADD CONSTRAINT relacionidentificaciongrupoarmadofuenteinformacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8393 (class 2606 OID 91940)
-- Dependencies: 7928 940 695 8870
-- Name: relacionidentificaciongrupoarmadoversion_idversion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadoversion
    ADD CONSTRAINT relacionidentificaciongrupoarmadoversion_idversion_fkey FOREIGN KEY (idversion) REFERENCES version(idversion);


--
-- TOC entry 8392 (class 2606 OID 91945)
-- Dependencies: 7486 331 695 8870
-- Name: relacionidentificaciongrupoarmadoversion_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadoversion
    ADD CONSTRAINT relacionidentificaciongrupoarmadoversion_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8391 (class 2606 OID 91950)
-- Dependencies: 7482 329 695 8870
-- Name: relacionidentificaciongrupoarmadoversion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionidentificaciongrupoarmadoversion
    ADD CONSTRAINT relacionidentificaciongrupoarmadoversion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8396 (class 2606 OID 91955)
-- Dependencies: 7478 326 697 8870
-- Name: relacionmagistradoaudiencia_idmagistrado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionmagistradoaudiencia
    ADD CONSTRAINT relacionmagistradoaudiencia_idmagistrado_fkey FOREIGN KEY (idmagistrado) REFERENCES magistrado(idmagistrado);


--
-- TOC entry 8395 (class 2606 OID 91960)
-- Dependencies: 7482 329 697 8870
-- Name: relacionmagistradoaudiencia_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionmagistradoaudiencia
    ADD CONSTRAINT relacionmagistradoaudiencia_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8401 (class 2606 OID 91965)
-- Dependencies: 7668 593 701 8870
-- Name: relacionperfilreporte_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionperfilreporte
    ADD CONSTRAINT relacionperfilreporte_fk1 FOREIGN KEY (idperfil) REFERENCES perfil(idperfil);


--
-- TOC entry 8400 (class 2606 OID 91970)
-- Dependencies: 7792 734 701 8870
-- Name: relacionperfilreporte_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionperfilreporte
    ADD CONSTRAINT relacionperfilreporte_fk2 FOREIGN KEY (idreporte) REFERENCES reporte(idreporte);


--
-- TOC entry 7986 (class 2606 OID 91975)
-- Dependencies: 7484 330 332 8870
-- Name: relacionpersonajuridicacolect_idpersonajuridicacolectivida_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolect_idpersonajuridicacolectivida_fkey FOREIGN KEY (idpersonajuridicacolectividad) REFERENCES personajuridicacolectividad(idpersonajuridicacolectividad);


--
-- TOC entry 7987 (class 2606 OID 91980)
-- Dependencies: 7912 902 332 8870
-- Name: relacionpersonajuridicacolect_idtiporelacionpersonajuridic_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolect_idtiporelacionpersonajuridic_fkey FOREIGN KEY (idtiporelacionpersonajuridicacolectividad) REFERENCES tiporelacionpersonajuridicacolectividad(idtiporelacionpersonajuridicacolectividad);


--
-- TOC entry 7988 (class 2606 OID 91985)
-- Dependencies: 7538 413 332 8870
-- Name: relacionpersonajuridicacolectivid_iddepartamentoexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectivid_iddepartamentoexpedicion_fkey FOREIGN KEY (iddepartamentoexpedicion) REFERENCES departamento(iddepartamento);


--
-- TOC entry 7989 (class 2606 OID 91990)
-- Dependencies: 7646 564 332 8870
-- Name: relacionpersonajuridicacolectividad_idmunicipioexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_idmunicipioexpedicion_fkey FOREIGN KEY (idmunicipioexpedicion) REFERENCES municipio(idmunicipio);


--
-- TOC entry 7990 (class 2606 OID 91995)
-- Dependencies: 7664 588 332 8870
-- Name: relacionpersonajuridicacolectividad_idpaisexpedicion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_idpaisexpedicion_fkey FOREIGN KEY (idpaisexpedicion) REFERENCES pais(idpais);


--
-- TOC entry 7991 (class 2606 OID 92000)
-- Dependencies: 7480 328 332 8870
-- Name: relacionpersonajuridicacolectividad_idpersonanatural_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_idpersonanatural_fkey FOREIGN KEY (idpersonanatural) REFERENCES persona(idpersona);


--
-- TOC entry 7992 (class 2606 OID 92005)
-- Dependencies: 7856 822 332 8870
-- Name: relacionpersonajuridicacolectividad_idtipodocumentopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_idtipodocumentopersona_fkey FOREIGN KEY (idtipodocumentopersona) REFERENCES tipodocumentopersona(idtipodocumentopersona);


--
-- TOC entry 7993 (class 2606 OID 92010)
-- Dependencies: 7482 329 332 8870
-- Name: relacionpersonajuridicacolectividad_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonajuridicacolectividad
    ADD CONSTRAINT relacionpersonajuridicacolectividad_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8408 (class 2606 OID 92015)
-- Dependencies: 7480 328 707 8870
-- Name: relacionpersonaparentescofk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonaparentesco
    ADD CONSTRAINT relacionpersonaparentescofk1 FOREIGN KEY (idpersonaprincipal) REFERENCES persona(idpersona);


--
-- TOC entry 8407 (class 2606 OID 92020)
-- Dependencies: 7480 328 707 8870
-- Name: relacionpersonaparentescofk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonaparentesco
    ADD CONSTRAINT relacionpersonaparentescofk2 FOREIGN KEY (idpersonasecundaria) REFERENCES persona(idpersona);


--
-- TOC entry 8406 (class 2606 OID 92025)
-- Dependencies: 7482 329 707 8870
-- Name: relacionpersonaparentescofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonaparentesco
    ADD CONSTRAINT relacionpersonaparentescofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8405 (class 2606 OID 92030)
-- Dependencies: 7910 901 707 8870
-- Name: relacionpersonaparentezcofk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonaparentesco
    ADD CONSTRAINT relacionpersonaparentezcofk3 FOREIGN KEY (idtiporelacionparentesco) REFERENCES tiporelacionparentesco(idtiporelacionparentesco);


--
-- TOC entry 8440 (class 2606 OID 92035)
-- Dependencies: 7772 713 713 727 727 8870
-- Name: relacionpostuladoversion; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionhistorialpga
    ADD CONSTRAINT relacionpostuladoversion FOREIGN KEY (idversion, radicado) REFERENCES relacionpostuladoversion(idversion, radicado);


--
-- TOC entry 8420 (class 2606 OID 92040)
-- Dependencies: 7688 623 715 8870
-- Name: relacionpublicacionexternapostulado_idpublicacionexterna_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacionexternapostulado
    ADD CONSTRAINT relacionpublicacionexternapostulado_idpublicacionexterna_fkey FOREIGN KEY (idpublicacionexterna) REFERENCES publicacionexterna(idpublicacionexterna);


--
-- TOC entry 8419 (class 2606 OID 92045)
-- Dependencies: 7486 331 715 8870
-- Name: relacionpublicacionexternapostulado_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacionexternapostulado
    ADD CONSTRAINT relacionpublicacionexternapostulado_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8418 (class 2606 OID 92050)
-- Dependencies: 7482 329 715 8870
-- Name: relacionpublicacionexternapostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacionexternapostulado
    ADD CONSTRAINT relacionpublicacionexternapostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8423 (class 2606 OID 92055)
-- Dependencies: 7690 626 717 8870
-- Name: relacionpublicacioninternapostulado_idpublicacioninterna_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacioninternapostulado
    ADD CONSTRAINT relacionpublicacioninternapostulado_idpublicacioninterna_fkey FOREIGN KEY (idpublicacioninterna) REFERENCES publicacioninterna(idpublicacioninterna);


--
-- TOC entry 8422 (class 2606 OID 92060)
-- Dependencies: 7486 331 717 8870
-- Name: relacionpublicacioninternapostulado_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacioninternapostulado
    ADD CONSTRAINT relacionpublicacioninternapostulado_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8421 (class 2606 OID 92065)
-- Dependencies: 7482 329 717 8870
-- Name: relacionpublicacioninternapostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpublicacioninternapostulado
    ADD CONSTRAINT relacionpublicacioninternapostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8429 (class 2606 OID 92070)
-- Dependencies: 7792 734 721 8870
-- Name: relacionreporteprogramacionreporte_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionreporteprogramacionreporte
    ADD CONSTRAINT relacionreporteprogramacionreporte_fk1 FOREIGN KEY (idreporte) REFERENCES reporte(idreporte);


--
-- TOC entry 8428 (class 2606 OID 92075)
-- Dependencies: 7686 620 721 8870
-- Name: relacionreporteprogramacionreporte_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionreporteprogramacionreporte
    ADD CONSTRAINT relacionreporteprogramacionreporte_fk2 FOREIGN KEY (idprogramacionreporte) REFERENCES programacionreporte(idprogramacionreporte);


--
-- TOC entry 8427 (class 2606 OID 92080)
-- Dependencies: 7574 461 721 8870
-- Name: relacionreporteprogramacionreporte_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionreporteprogramacionreporte
    ADD CONSTRAINT relacionreporteprogramacionreporte_fk3 FOREIGN KEY (idestadoprogramacionreporte) REFERENCES estadoprogramacionreporte(idestadoprogramacionreporte);


--
-- TOC entry 8433 (class 2606 OID 92085)
-- Dependencies: 7482 329 723 8870
-- Name: relacionsenalregionfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionsenalregion
    ADD CONSTRAINT relacionsenalregionfk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8432 (class 2606 OID 92090)
-- Dependencies: 7480 328 723 8870
-- Name: relacionseregion_idpersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionsenalregion
    ADD CONSTRAINT relacionseregion_idpersona_fkey FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8431 (class 2606 OID 92095)
-- Dependencies: 7696 634 723 8870
-- Name: relacionseregion_idregion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionsenalregion
    ADD CONSTRAINT relacionseregion_idregion_fkey FOREIGN KEY (idregion) REFERENCES region(idregion);


--
-- TOC entry 8430 (class 2606 OID 92100)
-- Dependencies: 7806 752 723 8870
-- Name: relacionseregion_idsenal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionsenalregion
    ADD CONSTRAINT relacionseregion_idsenal_fkey FOREIGN KEY (idsenal) REFERENCES senal(idsenal);


--
-- TOC entry 8436 (class 2606 OID 92105)
-- Dependencies: 7772 713 713 725 725 8870
-- Name: relacionversionevento; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionevento
    ADD CONSTRAINT relacionversionevento FOREIGN KEY (idversion, radicado) REFERENCES relacionpostuladoversion(idversion, radicado) ON UPDATE CASCADE;


--
-- TOC entry 8439 (class 2606 OID 92110)
-- Dependencies: 7620 520 727 8870
-- Name: relacionversionhistorialpga_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionhistorialpga
    ADD CONSTRAINT relacionversionhistorialpga_fk2 FOREIGN KEY (idhistorial) REFERENCES historialpersonaga(idhistorial);


--
-- TOC entry 8438 (class 2606 OID 92115)
-- Dependencies: 7620 520 727 8870
-- Name: relacionversionhistorialpga_idhistorial_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionhistorialpga
    ADD CONSTRAINT relacionversionhistorialpga_idhistorial_fkey FOREIGN KEY (idhistorial) REFERENCES historialpersonaga(idhistorial);


--
-- TOC entry 8444 (class 2606 OID 92120)
-- Dependencies: 7862 830 729 8870
-- Name: relacionvictimahecho_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT relacionvictimahecho_fk FOREIGN KEY (idtipoedad) REFERENCES tipoedad(idtipoedad);


--
-- TOC entry 8445 (class 2606 OID 92125)
-- Dependencies: 7906 894 729 8870
-- Name: relacionvictimahecho_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT relacionvictimahecho_fk1 FOREIGN KEY (idtiporangoedad) REFERENCES tiporangoedad(idtiporangoedad);


--
-- TOC entry 8446 (class 2606 OID 92130)
-- Dependencies: 7482 329 729 8870
-- Name: relacionvictimahechofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionvictimahecho
    ADD CONSTRAINT relacionvictimahechofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8448 (class 2606 OID 92135)
-- Dependencies: 7591 482 734 8870
-- Name: reporte_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporte
    ADD CONSTRAINT reporte_fk1 FOREIGN KEY (idformatoreporte) REFERENCES formatoreporte(idformatoreporte);


--
-- TOC entry 8451 (class 2606 OID 92140)
-- Dependencies: 7894 877 737 8870
-- Name: reposicionterminacionprocesopo_idtipoparticipanteaudiencia_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reposicionterminacionprocesopostulado
    ADD CONSTRAINT reposicionterminacionprocesopo_idtipoparticipanteaudiencia_fkey FOREIGN KEY (idtipoparticipanteaudiencia) REFERENCES tipoparticipanteaudiencia(idtipoparticipanteaudiencia);


--
-- TOC entry 8450 (class 2606 OID 92145)
-- Dependencies: 7532 404 737 8870
-- Name: reposicionterminacionprocesopostulad_iddecisionterminacion_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reposicionterminacionprocesopostulado
    ADD CONSTRAINT reposicionterminacionprocesopostulad_iddecisionterminacion_fkey FOREIGN KEY (iddecisionterminacion) REFERENCES decisionterminacionprocesopostulado(iddecisionterminacion);


--
-- TOC entry 8449 (class 2606 OID 92150)
-- Dependencies: 7482 329 737 8870
-- Name: reposicionterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reposicionterminacionprocesopostulado
    ADD CONSTRAINT reposicionterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8027 (class 2606 OID 92155)
-- Dependencies: 7480 328 355 8870
-- Name: representado_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apoderado
    ADD CONSTRAINT representado_fk FOREIGN KEY (idpersonarepresentado) REFERENCES persona(idpersona);


--
-- TOC entry 8452 (class 2606 OID 92160)
-- Dependencies: 7482 329 739 8870
-- Name: resolucionasignacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY resolucionasignacion
    ADD CONSTRAINT resolucionasignacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8453 (class 2606 OID 92165)
-- Dependencies: 7482 329 744 8870
-- Name: salaconocimiento_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY salaconocimiento
    ADD CONSTRAINT salaconocimiento_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8547 (class 2606 OID 92170)
-- Dependencies: 7802 747 940 8870
-- Name: salaversion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY version
    ADD CONSTRAINT salaversion_fk FOREIGN KEY (idsalaversion) REFERENCES salaversion(idsalaversion);


--
-- TOC entry 7984 (class 2606 OID 92175)
-- Dependencies: 7804 750 331 8870
-- Name: sede_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT sede_fk FOREIGN KEY (idsede) REFERENCES sede(idsede);


--
-- TOC entry 8459 (class 2606 OID 92180)
-- Dependencies: 7499 364 753 8870
-- Name: sentenciajyp_idaudiencia_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sentenciajyp
    ADD CONSTRAINT sentenciajyp_idaudiencia_fkey FOREIGN KEY (idaudiencia) REFERENCES audiencia(idaudiencia);


--
-- TOC entry 8458 (class 2606 OID 92185)
-- Dependencies: 7486 331 753 8870
-- Name: sentenciajyp_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sentenciajyp
    ADD CONSTRAINT sentenciajyp_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8457 (class 2606 OID 92190)
-- Dependencies: 7482 329 753 8870
-- Name: sentenciajyp_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sentenciajyp
    ADD CONSTRAINT sentenciajyp_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8460 (class 2606 OID 92195)
-- Dependencies: 7503 368 756 8870
-- Name: solicitudterminacionprocesopostulado_despacho_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_despacho_fkey FOREIGN KEY (despacho) REFERENCES autoridad(idautoridad);


--
-- TOC entry 8461 (class 2606 OID 92200)
-- Dependencies: 7482 329 756 8870
-- Name: solicitudterminacionprocesopostulado_fiscal_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_fiscal_fkey FOREIGN KEY (fiscal) REFERENCES usuario(login);


--
-- TOC entry 8462 (class 2606 OID 92205)
-- Dependencies: 7800 744 756 8870
-- Name: solicitudterminacionprocesopostulado_idsalaconocimiento_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_idsalaconocimiento_fkey FOREIGN KEY (idsalaconocimiento) REFERENCES salaconocimiento(idsalaconocimiento);


--
-- TOC entry 8463 (class 2606 OID 92210)
-- Dependencies: 7486 331 756 8870
-- Name: solicitudterminacionprocesopostulado_radicado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_radicado_fkey FOREIGN KEY (radicado) REFERENCES postulado(radicado);


--
-- TOC entry 8464 (class 2606 OID 92215)
-- Dependencies: 7482 329 756 8870
-- Name: solicitudterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY solicitudterminacionprocesopostulado
    ADD CONSTRAINT solicitudterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8465 (class 2606 OID 92220)
-- Dependencies: 7482 329 760 8870
-- Name: tendenciasexual_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tendenciasexual
    ADD CONSTRAINT tendenciasexual_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8468 (class 2606 OID 92225)
-- Dependencies: 7582 472 763 8870
-- Name: terminacionetapaprocesal_idetapaproceso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY terminacionetapaprocesal
    ADD CONSTRAINT terminacionetapaprocesal_idetapaproceso_fkey FOREIGN KEY (idetapaproceso) REFERENCES etapaproceso(idetapaproceso);


--
-- TOC entry 8467 (class 2606 OID 92230)
-- Dependencies: 7642 557 763 8870
-- Name: terminacionetapaprocesal_idmotivoterminacionetapapostulado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY terminacionetapaprocesal
    ADD CONSTRAINT terminacionetapaprocesal_idmotivoterminacionetapapostulado_fkey FOREIGN KEY (idmotivoterminacionetapapostulado) REFERENCES motivoterminacionetapapostulado(idmotivoterminacionetapapostulado);


--
-- TOC entry 8466 (class 2606 OID 92235)
-- Dependencies: 7482 329 763 8870
-- Name: terminacionetapaprocesal_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY terminacionetapaprocesal
    ADD CONSTRAINT terminacionetapaprocesal_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8469 (class 2606 OID 92240)
-- Dependencies: 7482 329 766 8870
-- Name: tipoaccesosalud_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaccesosalud
    ADD CONSTRAINT tipoaccesosalud_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8471 (class 2606 OID 92245)
-- Dependencies: 7900 885 769 8870
-- Name: tipoactaasignacion_idtipopostulado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactaasignacion
    ADD CONSTRAINT tipoactaasignacion_idtipopostulado_fkey FOREIGN KEY (idtipopostulado) REFERENCES tipopostulado(idtipopostulado);


--
-- TOC entry 8470 (class 2606 OID 92250)
-- Dependencies: 7482 329 769 8870
-- Name: tipoactaasignacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactaasignacion
    ADD CONSTRAINT tipoactaasignacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8020 (class 2606 OID 92255)
-- Dependencies: 7826 777 346 8870
-- Name: tipoalbumfotografico_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT tipoalbumfotografico_fk FOREIGN KEY (idtipoalbumfotografico) REFERENCES tipoalbumfotografico(idtipoalbumfotografico);


--
-- TOC entry 8475 (class 2606 OID 92260)
-- Dependencies: 7482 329 780 8870
-- Name: tipoaplicaley_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaplicaley
    ADD CONSTRAINT tipoaplicaley_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8026 (class 2606 OID 92265)
-- Dependencies: 7830 783 355 8870
-- Name: tipoapoderado; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apoderado
    ADD CONSTRAINT tipoapoderado FOREIGN KEY (idtipoapoderado) REFERENCES tipoapoderado(idtipoapoderado);


--
-- TOC entry 8477 (class 2606 OID 92270)
-- Dependencies: 7482 329 786 8870
-- Name: tipoaudiencia_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoaudiencia
    ADD CONSTRAINT tipoaudiencia_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8478 (class 2606 OID 92275)
-- Dependencies: 7482 329 792 8870
-- Name: tipocaratula_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocaratula
    ADD CONSTRAINT tipocaratula_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8480 (class 2606 OID 92280)
-- Dependencies: 7482 329 795 8870
-- Name: tipoclasificacionpersonajuridica_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoclasificacionpersonajuridica
    ADD CONSTRAINT tipoclasificacionpersonajuridica_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8482 (class 2606 OID 92285)
-- Dependencies: 7668 593 802 8870
-- Name: tipodesolicitud; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodesolicitud
    ADD CONSTRAINT tipodesolicitud FOREIGN KEY (idperfil) REFERENCES perfil(idperfil);


--
-- TOC entry 8483 (class 2606 OID 92290)
-- Dependencies: 7482 329 803 8870
-- Name: tipodiscapacidad_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodiscapacidad
    ADD CONSTRAINT tipodiscapacidad_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8099 (class 2606 OID 92295)
-- Dependencies: 7846 806 422 8870
-- Name: tipodocumento_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT tipodocumento_fk FOREIGN KEY (idtipodocumento) REFERENCES tipodocumento(idtipodocumento);


--
-- TOC entry 8486 (class 2606 OID 92300)
-- Dependencies: 7482 329 816 8870
-- Name: tipodocumentoedictoemplazatorio_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentoedictoemplazatorio
    ADD CONSTRAINT tipodocumentoedictoemplazatorio_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8487 (class 2606 OID 92305)
-- Dependencies: 7898 884 820 8870
-- Name: tipodocumentoidentidad_idtipopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentoidentidad
    ADD CONSTRAINT tipodocumentoidentidad_idtipopersona_fkey FOREIGN KEY (idtipopersona) REFERENCES tipopersona(idtipopersona);


--
-- TOC entry 8115 (class 2606 OID 92310)
-- Dependencies: 7856 822 437 8870
-- Name: tipodocumentopersona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT tipodocumentopersona_fk FOREIGN KEY (idtipodocumentopersona) REFERENCES tipodocumentopersona(idtipodocumentopersona);


--
-- TOC entry 8493 (class 2606 OID 92315)
-- Dependencies: 7898 884 836 8870
-- Name: tipoestadopersona_idtipopersona_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoestadopersona
    ADD CONSTRAINT tipoestadopersona_idtipopersona_fkey FOREIGN KEY (idtipopersona) REFERENCES tipopersona(idtipopersona);


--
-- TOC entry 8492 (class 2606 OID 92320)
-- Dependencies: 7482 329 836 8870
-- Name: tipoestadopersona_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoestadopersona
    ADD CONSTRAINT tipoestadopersona_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8145 (class 2606 OID 92325)
-- Dependencies: 7868 838 475 8870
-- Name: tipofecha_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evento
    ADD CONSTRAINT tipofecha_fk FOREIGN KEY (idtipofecha) REFERENCES tipofecha(idtipofecha);


--
-- TOC entry 8197 (class 2606 OID 92330)
-- Dependencies: 7868 838 516 8870
-- Name: tipofechah_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY hecho
    ADD CONSTRAINT tipofechah_fk FOREIGN KEY (idtipofecha) REFERENCES tipofecha(idtipofecha);


--
-- TOC entry 8435 (class 2606 OID 92335)
-- Dependencies: 7872 845 725 8870
-- Name: tipohechoversion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionevento
    ADD CONSTRAINT tipohechoversion_fk FOREIGN KEY (idtipohechoversion) REFERENCES tipohechoversion(idtipohechoversion);


--
-- TOC entry 8497 (class 2606 OID 92340)
-- Dependencies: 7482 329 848 8870
-- Name: tipohistorialreclusion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohistorialreclusion
    ADD CONSTRAINT tipohistorialreclusion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8498 (class 2606 OID 92345)
-- Dependencies: 7482 329 851 8870
-- Name: tipoidentificaciongrupoarmado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoidentificaciongrupoarmado
    ADD CONSTRAINT tipoidentificaciongrupoarmado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8499 (class 2606 OID 92350)
-- Dependencies: 7482 329 854 8870
-- Name: tipoinactivopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoinactivopostulado
    ADD CONSTRAINT tipoinactivopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8500 (class 2606 OID 92355)
-- Dependencies: 7482 329 857 8870
-- Name: tipojefe_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipojefe
    ADD CONSTRAINT tipojefe_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8502 (class 2606 OID 92360)
-- Dependencies: 7482 329 862 8870
-- Name: tipomediopublicacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipomediopublicacion
    ADD CONSTRAINT tipomediopublicacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8503 (class 2606 OID 92365)
-- Dependencies: 7482 329 865 8870
-- Name: tipomoneda_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipomoneda
    ADD CONSTRAINT tipomoneda_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8504 (class 2606 OID 92370)
-- Dependencies: 7482 329 868 8870
-- Name: tiponivelsisben_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiponivelsisben
    ADD CONSTRAINT tiponivelsisben_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8324 (class 2606 OID 92375)
-- Dependencies: 7892 874 651 8870
-- Name: tipoparticipacion_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT tipoparticipacion_fk FOREIGN KEY (idtipoparticipacion) REFERENCES tipoparticipacion(idtipoparticipacion);


--
-- TOC entry 8507 (class 2606 OID 92380)
-- Dependencies: 7482 329 877 8870
-- Name: tipoparticipanteaudiencia_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoparticipanteaudiencia
    ADD CONSTRAINT tipoparticipanteaudiencia_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8146 (class 2606 OID 92385)
-- Dependencies: 7896 880 485 8870
-- Name: tipoperfilfotopersona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fotos
    ADD CONSTRAINT tipoperfilfotopersona_fk FOREIGN KEY (tipoperfilfotopersona) REFERENCES tipoperfilfotopersona(idtipoperfilfotopersona);


--
-- TOC entry 8148 (class 2606 OID 92390)
-- Dependencies: 7896 880 486 8870
-- Name: tipoperfilfotopersona_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fotos_audit
    ADD CONSTRAINT tipoperfilfotopersona_fk FOREIGN KEY (tipoperfilfotopersona) REFERENCES tipoperfilfotopersona(idtipoperfilfotopersona);


--
-- TOC entry 8510 (class 2606 OID 92395)
-- Dependencies: 7482 329 888 8870
-- Name: tipopreclusionpostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipopreclusionpostulado
    ADD CONSTRAINT tipopreclusionpostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8511 (class 2606 OID 92400)
-- Dependencies: 7482 329 891 8870
-- Name: tipoprocesojyp_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoprocesojyp
    ADD CONSTRAINT tipoprocesojyp_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8514 (class 2606 OID 92405)
-- Dependencies: 7482 329 901 8870
-- Name: tiporelacionparentesco_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporelacionparentesco
    ADD CONSTRAINT tiporelacionparentesco_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8515 (class 2606 OID 92410)
-- Dependencies: 7482 329 902 8870
-- Name: tiporelacionpersonajuridicacolectividad_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporelacionpersonajuridicacolectividad
    ADD CONSTRAINT tiporelacionpersonajuridicacolectividad_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8516 (class 2606 OID 92415)
-- Dependencies: 7482 329 905 8870
-- Name: tiposectortrabajo_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiposectortrabajo
    ADD CONSTRAINT tiposectortrabajo_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8518 (class 2606 OID 92420)
-- Dependencies: 7838 795 908 8870
-- Name: tiposubclasificacionpersonaju_idtipoclasificacionpersonaju_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiposubclasificacionpersonajuridica
    ADD CONSTRAINT tiposubclasificacionpersonaju_idtipoclasificacionpersonaju_fkey FOREIGN KEY (idtipoclasificacionpersonajuridica) REFERENCES tipoclasificacionpersonajuridica(idtipoclasificacionpersonajuridica);


--
-- TOC entry 8517 (class 2606 OID 92425)
-- Dependencies: 7482 329 908 8870
-- Name: tiposubclasificacionpersonajuridica_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiposubclasificacionpersonajuridica
    ADD CONSTRAINT tiposubclasificacionpersonajuridica_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8519 (class 2606 OID 92430)
-- Dependencies: 7482 329 911 8870
-- Name: tipoterminacionprocesopostulado_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoterminacionprocesopostulado
    ADD CONSTRAINT tipoterminacionprocesopostulado_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8520 (class 2606 OID 92435)
-- Dependencies: 7482 329 916 8870
-- Name: tipotrabajo_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipotrabajo
    ADD CONSTRAINT tipotrabajo_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8521 (class 2606 OID 92440)
-- Dependencies: 7482 329 920 8870
-- Name: tipoubicacion_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoubicacion
    ADD CONSTRAINT tipoubicacion_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8522 (class 2606 OID 92445)
-- Dependencies: 7480 328 927 8870
-- Name: titularbienfk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_1 FOREIGN KEY (idpersona) REFERENCES persona(idpersona);


--
-- TOC entry 8523 (class 2606 OID 92450)
-- Dependencies: 7505 370 927 8870
-- Name: titularbienfk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_2 FOREIGN KEY (idbien) REFERENCES bien(idbien);


--
-- TOC entry 8524 (class 2606 OID 92455)
-- Dependencies: 7920 914 927 8870
-- Name: titularbienfk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_3 FOREIGN KEY (idtipotitular) REFERENCES tipotitular(idtipotitular);


--
-- TOC entry 8525 (class 2606 OID 92460)
-- Dependencies: 7860 828 927 8870
-- Name: titularbienfk_4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_4 FOREIGN KEY (idtipodocumentotitularidadbien) REFERENCES tipodocumentotitularidadbien(idtipodocumentotitularidadbien);


--
-- TOC entry 8526 (class 2606 OID 92465)
-- Dependencies: 7664 588 927 8870
-- Name: titularbienfk_5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_5 FOREIGN KEY (idpaisdocumentotitularidad) REFERENCES pais(idpais);


--
-- TOC entry 8527 (class 2606 OID 92470)
-- Dependencies: 7538 413 927 8870
-- Name: titularbienfk_6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_6 FOREIGN KEY (iddepartamentodocumentotitularidad) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8528 (class 2606 OID 92475)
-- Dependencies: 7646 564 927 8870
-- Name: titularbienfk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_7 FOREIGN KEY (idmunicipiodocumentotitularidad) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8529 (class 2606 OID 92480)
-- Dependencies: 7482 329 927 8870
-- Name: titularbienfk_8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY titularbien
    ADD CONSTRAINT titularbienfk_8 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8534 (class 2606 OID 92485)
-- Dependencies: 7922 916 929 8870
-- Name: trabajo_idtipotrabajo_forkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT trabajo_idtipotrabajo_forkey FOREIGN KEY (idtipotrabajo) REFERENCES tipotrabajo(idtipotrabajo);


--
-- TOC entry 8535 (class 2606 OID 92490)
-- Dependencies: 7482 329 929 8870
-- Name: trabajofk_7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trabajo
    ADD CONSTRAINT trabajofk_7 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8540 (class 2606 OID 92495)
-- Dependencies: 7618 516 932 8870
-- Name: ubicacioncuerpo_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo
    ADD CONSTRAINT ubicacioncuerpo_fk1 FOREIGN KEY (idhecho) REFERENCES hecho(idhecho);


--
-- TOC entry 8539 (class 2606 OID 92500)
-- Dependencies: 7926 924 932 8870
-- Name: ubicacioncuerpo_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo
    ADD CONSTRAINT ubicacioncuerpo_fk2 FOREIGN KEY (idtipoubicacioncuerpo) REFERENCES tipoubicacioncuerpo(idtipoubicacioncuerpo);


--
-- TOC entry 8538 (class 2606 OID 92505)
-- Dependencies: 7664 588 932 8870
-- Name: ubicacioncuerpo_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo
    ADD CONSTRAINT ubicacioncuerpo_fk3 FOREIGN KEY (idpais) REFERENCES pais(idpais);


--
-- TOC entry 8537 (class 2606 OID 92510)
-- Dependencies: 7538 413 932 8870
-- Name: ubicacioncuerpo_fk4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo
    ADD CONSTRAINT ubicacioncuerpo_fk4 FOREIGN KEY (iddepartamento) REFERENCES departamento(iddepartamento);


--
-- TOC entry 8536 (class 2606 OID 92515)
-- Dependencies: 7646 564 932 8870
-- Name: ubicacioncuerpo_fk5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ubicacioncuerpo
    ADD CONSTRAINT ubicacioncuerpo_fk5 FOREIGN KEY (idmunicipio) REFERENCES municipio(idmunicipio);


--
-- TOC entry 8544 (class 2606 OID 92520)
-- Dependencies: 7517 382 935 8870
-- Name: unificacioncarpeta_carpetaquequeda_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacioncarpeta
    ADD CONSTRAINT unificacioncarpeta_carpetaquequeda_fkey FOREIGN KEY (carpetaquequeda) REFERENCES carpetahecho(idcarpetahecho);


--
-- TOC entry 8543 (class 2606 OID 92525)
-- Dependencies: 7517 382 935 8870
-- Name: unificacioncarpeta_carpetaunificada_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacioncarpeta
    ADD CONSTRAINT unificacioncarpeta_carpetaunificada_fkey FOREIGN KEY (carpetaunificada) REFERENCES carpetahecho(idcarpetahecho);


--
-- TOC entry 8542 (class 2606 OID 92530)
-- Dependencies: 7482 329 935 8870
-- Name: unificacioncarpeta_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacioncarpeta
    ADD CONSTRAINT unificacioncarpeta_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8541 (class 2606 OID 92535)
-- Dependencies: 7482 329 935 8870
-- Name: unificacioncarpeta_usuario_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacioncarpeta
    ADD CONSTRAINT unificacioncarpeta_usuario_fkey1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8545 (class 2606 OID 92540)
-- Dependencies: 7482 329 937 8870
-- Name: unificacionpersona_usuario_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY unificacionpersona
    ADD CONSTRAINT unificacionpersona_usuario_fkey FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 10924 (class 0 OID 0)
-- Dependencies: 8545
-- Name: CONSTRAINT unificacionpersona_usuario_fkey ON unificacionpersona; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON CONSTRAINT unificacionpersona_usuario_fkey ON unificacionpersona IS 'relacion la tabla usuario para garantizar la integridad referencial';


--
-- TOC entry 8434 (class 2606 OID 92545)
-- Dependencies: 7482 329 725 8870
-- Name: usuario; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionversionevento
    ADD CONSTRAINT usuario FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8325 (class 2606 OID 92550)
-- Dependencies: 7482 329 651 8870
-- Name: usuario; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionautorhecho
    ADD CONSTRAINT usuario FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8489 (class 2606 OID 92555)
-- Dependencies: 7482 329 825 8870
-- Name: usuario_f1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentopostulacion
    ADD CONSTRAINT usuario_f1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8485 (class 2606 OID 92560)
-- Dependencies: 7482 329 809 8870
-- Name: usuario_f1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentocarpeta
    ADD CONSTRAINT usuario_f1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8117 (class 2606 OID 92565)
-- Dependencies: 7482 329 440 8870
-- Name: usuario_f2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopostulacion
    ADD CONSTRAINT usuario_f2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8412 (class 2606 OID 92570)
-- Dependencies: 7482 329 711 8870
-- Name: usuario_f2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladodocumentopostulacion
    ADD CONSTRAINT usuario_f2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8102 (class 2606 OID 92575)
-- Dependencies: 7482 329 425 8870
-- Name: usuario_f2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentocarpeta
    ADD CONSTRAINT usuario_f2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8397 (class 2606 OID 92580)
-- Dependencies: 7482 329 699 8870
-- Name: usuario_f3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionnotificacioncorreopostulado
    ADD CONSTRAINT usuario_f3 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8300 (class 2606 OID 92585)
-- Dependencies: 7482 329 635 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY registrohecho
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8065 (class 2606 OID 92590)
-- Dependencies: 7482 329 397 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY controlregistrohechos
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8179 (class 2606 OID 92595)
-- Dependencies: 7482 329 504 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY georeferenciacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8484 (class 2606 OID 92600)
-- Dependencies: 7482 329 806 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8488 (class 2606 OID 92605)
-- Dependencies: 7482 329 822 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipodocumentopersona
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8116 (class 2606 OID 92610)
-- Dependencies: 7482 329 437 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documentopersona
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8424 (class 2606 OID 92615)
-- Dependencies: 7482 329 719 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionregistrohechodocumento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8025 (class 2606 OID 92620)
-- Dependencies: 7482 329 355 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY apoderado
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8476 (class 2606 OID 92625)
-- Dependencies: 7482 329 783 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoapoderado
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8129 (class 2606 OID 92630)
-- Dependencies: 7482 329 472 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapaproceso
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8241 (class 2606 OID 92635)
-- Dependencies: 7482 329 565 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY nivel
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8456 (class 2606 OID 92640)
-- Dependencies: 7482 329 750 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sede
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8122 (class 2606 OID 92645)
-- Dependencies: 7482 329 452 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadoetapaproceso
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 7985 (class 2606 OID 92650)
-- Dependencies: 7482 329 331 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postulado
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8506 (class 2606 OID 92655)
-- Dependencies: 7482 329 874 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoparticipacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8063 (class 2606 OID 92660)
-- Dependencies: 7482 329 394 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY connotacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8254 (class 2606 OID 92665)
-- Dependencies: 7482 329 584 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenhechoversion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8495 (class 2606 OID 92670)
-- Dependencies: 7482 329 845 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohechoversion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8238 (class 2606 OID 92675)
-- Dependencies: 7482 329 560 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY movil
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8236 (class 2606 OID 92680)
-- Dependencies: 7482 329 554 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY modusoperandi
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8454 (class 2606 OID 92685)
-- Dependencies: 7482 329 747 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY salaversion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8546 (class 2606 OID 92690)
-- Dependencies: 7482 329 940 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY version
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8494 (class 2606 OID 92695)
-- Dependencies: 7482 329 838 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipofecha
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8251 (class 2606 OID 92700)
-- Dependencies: 7482 329 578 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenevento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8068 (class 2606 OID 92705)
-- Dependencies: 7482 329 400 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY datosbasicos
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8490 (class 2606 OID 92710)
-- Dependencies: 7482 329 830 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoedad
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8512 (class 2606 OID 92715)
-- Dependencies: 7482 329 894 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporangoedad
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8505 (class 2606 OID 92720)
-- Dependencies: 7482 329 871 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoorigenfuenteinformacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8012 (class 2606 OID 92725)
-- Dependencies: 7482 329 340 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actividadfuenteinformacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8126 (class 2606 OID 92730)
-- Dependencies: 7482 329 466 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapaflujoinformacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8252 (class 2606 OID 92735)
-- Dependencies: 7482 329 581 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY origenfuenteinformacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8093 (class 2606 OID 92740)
-- Dependencies: 7482 329 419 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY despacho
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8342 (class 2606 OID 92745)
-- Dependencies: 7482 329 663 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relaciondespacho
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8513 (class 2606 OID 92750)
-- Dependencies: 7482 329 897 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tiporelacionevento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8351 (class 2606 OID 92755)
-- Dependencies: 7482 329 669 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionevento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8501 (class 2606 OID 92760)
-- Dependencies: 7482 329 859 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoley
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8123 (class 2606 OID 92765)
-- Dependencies: 7482 329 455 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadohistoricoprocesal
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8481 (class 2606 OID 92770)
-- Dependencies: 7482 329 798 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocompulsacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8160 (class 2606 OID 92775)
-- Dependencies: 7482 329 492 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fuenteinformaciondatos
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login) MATCH FULL;


--
-- TOC entry 8358 (class 2606 OID 92781)
-- Dependencies: 7482 329 673 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventomodusoperandi
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8355 (class 2606 OID 92788)
-- Dependencies: 7482 329 671 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioneventofuenteinfo
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8385 (class 2606 OID 92793)
-- Dependencies: 7482 329 691 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionhistoricoprocesalfuenteinfo
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8058 (class 2606 OID 92798)
-- Dependencies: 7482 329 382 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY carpetahecho
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8329 (class 2606 OID 92803)
-- Dependencies: 7482 329 655 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncarpetahechoevento
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8293 (class 2606 OID 92808)
-- Dependencies: 7482 329 631 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY raza
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8447 (class 2606 OID 92813)
-- Dependencies: 7482 329 731 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY religion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8255 (class 2606 OID 92818)
-- Dependencies: 7482 329 589 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY partidos_politicos
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8223 (class 2606 OID 92823)
-- Dependencies: 7482 329 534 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identificacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8189 (class 2606 OID 92828)
-- Dependencies: 7482 329 511 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY grupos_etnicos
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8001 (class 2606 OID 92833)
-- Dependencies: 7482 329 335 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY acta_asignacion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8409 (class 2606 OID 92838)
-- Dependencies: 7482 329 709 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoacta
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8508 (class 2606 OID 92843)
-- Dependencies: 7482 329 880 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoperfilfotopersona
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8474 (class 2606 OID 92848)
-- Dependencies: 7482 329 777 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoalbumfotografico
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8021 (class 2606 OID 92853)
-- Dependencies: 7482 329 346 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotografico
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8304 (class 2606 OID 92858)
-- Dependencies: 7482 329 640 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionalbumfotograficofoto
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8022 (class 2606 OID 92863)
-- Dependencies: 7482 329 349 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY albumfotograficodownload
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8416 (class 2606 OID 92868)
-- Dependencies: 7482 329 713 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoversion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8362 (class 2606 OID 92873)
-- Dependencies: 7482 329 675 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfiscaldespachoversion
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8037 (class 2606 OID 92878)
-- Dependencies: 7482 329 364 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY audiencia
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8230 (class 2606 OID 92883)
-- Dependencies: 7482 329 540 8870
-- Name: usuario_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY jornadaaudiencia
    ADD CONSTRAINT usuario_fk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8124 (class 2606 OID 92888)
-- Dependencies: 7482 329 458 8870
-- Name: usuario_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estadopostulado
    ADD CONSTRAINT usuario_fk1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8491 (class 2606 OID 92893)
-- Dependencies: 7482 329 833 8870
-- Name: usuario_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoestadonotificacioncorreo
    ADD CONSTRAINT usuario_fk1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8509 (class 2606 OID 92898)
-- Dependencies: 7482 329 885 8870
-- Name: usuario_fk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipopostulado
    ADD CONSTRAINT usuario_fk1 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8127 (class 2606 OID 92903)
-- Dependencies: 7482 329 469 8870
-- Name: usuario_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY etapahistoricoprocesal
    ADD CONSTRAINT usuario_fk2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8472 (class 2606 OID 92908)
-- Dependencies: 7482 329 772 8870
-- Name: usuario_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipoactuacionhistoricoprocesal
    ADD CONSTRAINT usuario_fk2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8249 (class 2606 OID 92913)
-- Dependencies: 7482 329 573 8870
-- Name: usuario_fk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY notificacioncorreo
    ADD CONSTRAINT usuario_fk2 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8013 (class 2606 OID 92918)
-- Dependencies: 7482 329 343 8870
-- Name: usuario_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actuacionhistoricoprocesal
    ADD CONSTRAINT usuario_fk3 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8301 (class 2606 OID 92923)
-- Dependencies: 7482 329 638 8870
-- Name: usuario_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionactuacionhistoricoprocesalpersona
    ADD CONSTRAINT usuario_fk3 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8402 (class 2606 OID 92928)
-- Dependencies: 7482 329 703 8870
-- Name: usuario_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpersonacompulsacion
    ADD CONSTRAINT usuario_fk3 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8339 (class 2606 OID 92933)
-- Dependencies: 7482 329 661 8870
-- Name: usuario_fk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacioncompulsacionhistoricoprocesal
    ADD CONSTRAINT usuario_fk3 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8222 (class 2606 OID 92938)
-- Dependencies: 7482 329 530 8870
-- Name: usuario_fk5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY historicoprocesal
    ADD CONSTRAINT usuario_fk5 FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8100 (class 2606 OID 92943)
-- Dependencies: 7482 329 422 8870
-- Name: usuario_pk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT usuario_pk FOREIGN KEY (usuario) REFERENCES usuario(login);


--
-- TOC entry 8101 (class 2606 OID 92948)
-- Dependencies: 7482 329 422 8870
-- Name: usuariofirma_pk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY documento
    ADD CONSTRAINT usuariofirma_pk FOREIGN KEY (usuariofirma) REFERENCES usuario(login);


--
-- TOC entry 7960 (class 2606 OID 92953)
-- Dependencies: 7668 593 329 8870
-- Name: usuariofk1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuariofk1 FOREIGN KEY (idperfil) REFERENCES perfil(idperfil);


--
-- TOC entry 7959 (class 2606 OID 92958)
-- Dependencies: 7515 381 329 8870
-- Name: usuariofk2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuariofk2 FOREIGN KEY (idcargo) REFERENCES cargo(idcargo);


--
-- TOC entry 7958 (class 2606 OID 92963)
-- Dependencies: 7682 616 329 8870
-- Name: usuariofk3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuariofk3 FOREIGN KEY (idprocedenciausuario) REFERENCES procedenciausuario(idprocedenciausuario);


--
-- TOC entry 8064 (class 2606 OID 92968)
-- Dependencies: 7482 329 397 8870
-- Name: usuarioreceptor_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY controlregistrohechos
    ADD CONSTRAINT usuarioreceptor_fk FOREIGN KEY (usuarioreceptor) REFERENCES usuario(login);


--
-- TOC entry 8415 (class 2606 OID 92973)
-- Dependencies: 7928 940 713 8870
-- Name: version_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionpostuladoversion
    ADD CONSTRAINT version_fk FOREIGN KEY (idversion) REFERENCES version(idversion);


--
-- TOC entry 8361 (class 2606 OID 92978)
-- Dependencies: 7928 940 675 8870
-- Name: version_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY relacionfiscaldespachoversion
    ADD CONSTRAINT version_fk FOREIGN KEY (idversion) REFERENCES version(idversion);


--
-- TOC entry 8874 (class 0 OID 0)
-- Dependencies: 11
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2014-10-09 18:18:27 CDT

--
-- PostgreSQL database dump complete
--

